[Issue 5189] New: throw in DLL
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Mon Nov  8 06:39:55 PST 2010
    
    
  
http://d.puremagic.com/issues/show_bug.cgi?id=5189
           Summary: throw in DLL
           Product: D
           Version: D2
          Platform: All
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: sean at invisibleduck.org
        ReportedBy: zan77137 at nifty.com
--- Comment #0 from SHOO <zan77137 at nifty.com> 2010-11-08 06:38:52 PST ---
An D'exception which occurred in the inside of DLL is not caught at the outside
of DLL.
It is necessary for druntime to be fixed if this is a bug.
Perhaps there is the bug in the _object.d(L716). 
----------------
    override equals_t opEquals(Object o)
    {
        TypeInfo_Class c;
        return this is o ||
                ((c = cast(TypeInfo_Class)o) !is null &&
                 this.info.name == c.classinfo.name);
    }
----------------
Is not this code a mistake of the following code?
----------------
    override equals_t opEquals(Object o)
    {
        TypeInfo_Class c;
        return this is o ||
                ((c = cast(TypeInfo_Class)o) !is null &&
                 this.info.name == c.info.name); // <-- c.classinfo.name =>
c.info.name
    }
----------------
The state of each evaluation is examined by the following.
----------------
module main;
import std.stdio;
class A
{
}
void main()
{
    auto a = new A;
    TypeInfo_Class c;
    auto id1 = typeid(cast(Object)a);
    auto id2 = typeid(A);
    bool b1 = id1 is id2;
    bool b2 = (c = cast(TypeInfo_Class)id2) !is null;
    bool b3 = id1.info.name == c.info.name;
    writefln("id1 == id2 : %s || (%s && %s)", b1, b2, b3);
    writefln("id1 == id2 : %s", id1 == id2);
    writefln("%s, %s, %s", id1.info.name, c.classinfo.name, c.info.name);
}
----------------
Result:
----------------
id1 == id2 : true || (true && false)
id1 == id2 : true
main.A, TypeInfo_Class, main.A
----------------
-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
    
    
More information about the Digitalmars-d-bugs
mailing list