Bug 2739 – _argptr is invalid for functions nested in class methods

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-03-17T12:58:00Z
Last change time
2015-06-09T01:21:07Z
Keywords
wrong-code
Assigned to
bugzilla
Creator
burton-radons

Comments

Comment #0 by burton-radons — 2009-03-17T12:58:36Z
This code: import std.stdio; void external (...) { writef ("external: %s\n", *cast (int *) _argptr); } class C { void method () { void internal (...) { writef ("internal: %s\n", *cast (int *) _argptr); } internal (42); } } void main () { external (42); (new C).method (); } Prints: external: 42 internal: <random value> As far as I can tell _argptr is not just at the wrong offset, it's completely wrong altogether.
Comment #1 by bugzilla — 2009-04-01T13:56:19Z
Fixed DMD 2.027