https://d.puremagic.com/issues/show_bug.cgi?id=12516
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: [email protected]
ReportedBy: [email protected]
--- Comment #0 from David Spies <[email protected]> 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;
@safe
void main() {
typeid(string).getHash(&x);
}
---
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: -------