www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1708] New: CodeView: parent-scope not set for nested functions

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

           Summary: CodeView: parent-scope not set for nested functions
           Product: D
           Version: 2.009
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: jascha mainia.de


par should point to the entry of main.func

-----------------------------------------------------------------------
S_GPROC32    par=x00000000 end=x00000000 next=x00000000 len=x001f debsta=x0007
debend=x001b off=x0000 seg=x0000 proctyp=x1004 near
_D4main4funcFkZk6nestedMFkZv 
segidx = 5 offset = 00a1, lcfd = ec12, fd = 1, td = 2, targdisp = x0000
-----------------------------------------------------------------------

import std.stdio;
import std.string;

uint func(uint outer_param)
{
    uint outer_var = 56789+outer_param;

    void nested(uint nested_param)
    {
        int nested_var = 1234+nested_param;
        outer_var += nested_var;
    }

    nested(outer_param*123);
    return outer_var;
}

void main(string[] args)
{
    writefln("%d", func(atoi(args[1])));
}


-- 
Dec 02 2007