www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5189] New: throw in DLL

reply d-bugmail puremagic.com writes:
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 invisibleduck.org
        ReportedBy: zan77137 nifty.com


--- Comment #0 from SHOO <zan77137 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: -------
Nov 08 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5189


SHOO <zan77137 nifty.com> changed:

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


--- Comment #1 from SHOO <zan77137 nifty.com> 2011-01-19 06:57:57 PST ---
Fixed r415.
http://www.dsource.org/projects/druntime/changeset/415

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 19 2011