www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10664] New: Win64: exception handling does not work with COMDAT folding

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

           Summary: Win64: exception handling does not work with COMDAT
                    folding
           Product: D
           Version: D1 & D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: r.sagitario gmx.de



PDT ---
Another excerpt from the phobos unittests:

import core.exception;

T collectException(T = Exception, E)(lazy E expression, ref E result)
{
    try
    {
        result = expression();
    }
    catch (T e)
    {
        return e;
    }
    return null;
}

void main()
{
    int b;
    int foo() { throw new Exception("blah"); }
    assert(collectException(foo(), b));

    int[] a = new int[3];
    collectException!RangeError(a[4], b);
}

compile with "dmd -m64 test.d" and run:

core.exception.RangeError test(23): Range violation
----------------
0x000007F627E337DF in rt.lifetime.__setArrayAllocLength at
M:\s\d\rainers\drunti
me\src\rt\lifetime.d(283)
0x000007F627E31508 in rt.lifetime._d_newarrayT at
M:\s\d\rainers\druntime\src\rt
\lifetime.d(781)
0x000007F627E31237 in test.main.__dgliteral12
0x000007F627E31197 in test.main.foo at M:\s\d\rainers\bugs\rs144\test.d(19)
0x000007F627E311E8 in test.main.foo
0x000007F627E310AA in D main at M:\s\d\rainers\bugs\rs144\test.d(20)
0x000007F627E32FDE in rt.dmain2._d_run_main.tryExec.printInfoBlock at
M:\s\d\rai
ners\druntime\src\rt\dmain2.d(556)
0x000007F627E3222E in rt.dmain2._d_run_main at
M:\s\d\rainers\druntime\src\rt\dm
ain2.d(469)
0x000007F627E330D6 in rt.dmain2._d_run_main.tryExec.print at
M:\s\d\rainers\drun
time\src\rt\dmain2.d(567)
0x000007F627E3222E in rt.dmain2._d_run_main at
M:\s\d\rainers\druntime\src\rt\dm
ain2.d(469)
0x000007F627E321CE in rt.dmain2._d_run_main at
M:\s\d\rainers\druntime\src\rt\dm
ain2.d(463)
0x000007F627E31276 in test.main.__dgliteral13 at
M:\s\d\rainers\bugs\rs144\test.
d(23)
0x000007F627E4AD0B in core.demangle.Demangle.parseType at
M:\s\d\rainers\druntim
e\src\core\demangle.d(862)
0x000007FB2EDF1832 in BaseThreadInitThunk
0x000007FB2EF8D609 in RtlUserThreadStart
----------------

It works with -g or more specifically with

dmd -m64 -L/OPT:NOICF test.d

So it seems exception information for the two collectException instantiations
are merged.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 18 2013