[Issue 9975] New: pointsTo asserts because of false pointer in union

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 21 05:42:45 PDT 2013


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

           Summary: pointsTo asserts because of false pointer in union
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: code at dawg.eu


--- Comment #0 from Martin Nowak <code at dawg.eu> 2013-04-21 05:42:44 PDT ---
import std.exception;

struct S
{
    union
    {
        size_t sz;
        string s;
    }
}

void main()
{
    S a, b;
    a.sz = -1;
    assert(!pointsTo(a, b));
}

----

The problem is that pointsTo checks every .tupleof member thus the example
asserts because a.s pointsTo b.

http://www.digitalmars.com/d/archives/digitalmars/D/learn/overzealous_pointsTo_23203.html

-- 
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