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: bugzi...@digitalmars.com
        ReportedBy: burton-rad...@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.


-- 

Reply via email to