www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12516] New: TypeInfo.getHash should not be trusted


           Summary: TypeInfo.getHash should not be trusted
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody puremagic.com
        ReportedBy: dspies ualberta.ca

--- Comment #0 from David Spies <dspies ualberta.ca> 2014-04-03 16:11:53 PDT ---
When getHash is overridden, it may try to dereference the void pointer, so it's
not safe if the pointer is to the wrong type.

import std.string;

static int x = 35873;

void main() {


An example program which segfaults within a  safe method

Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 03 2014