[Issue 2739] New: _argptr is invalid for functions nested in class methods

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 17 10:58:33 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2739

           Summary: _argptr is invalid for functions nested in class methods
           Product: D
           Version: 2.025
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: burton-radons at shaw.ca


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.


-- 



More information about the Digitalmars-d-bugs mailing list