www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2739] New: _argptr is invalid for functions nested in class methods

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: burton-radons 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.


-- 
Mar 17 2009
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2739


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #1 from bugzilla digitalmars.com  2009-04-01 13:56 -------
Fixed DMD 2.027


-- 
Apr 01 2009