Bug 2328 – setTypeInfo in gc.d backwards.

Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P2
Component
phobos
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2008-09-02T13:36:00Z
Last change time
2014-03-01T00:36:51Z
Assigned to
nobody
Creator
dsimcha

Comments

Comment #0 by dsimcha — 2008-09-02T13:36:16Z
According to Phobos object docs: uint flags(); Get flags for type: 1 means GC should scan for pointers This is implemented correctly. import std.stdio; void main() { writefln(typeid(uint).flags & 1); //0 writefln(typeid(uint*).flags & 1); //1 writefln(typeid(void*).flags & 1); //1 writefln(typeid(float).flags & 1); //0 } However, source code to setTypeInfo: void setTypeInfo(TypeInfo ti, void* p) { if (ti.flags() & 1) hasNoPointers(p); else hasPointers(p); } The if statement in this code is clearly backwards.
Comment #1 by dsimcha — 2009-01-25T22:15:37Z
No longer relevant to D2, but should still be fixed in D1.
Comment #2 by github-bugzilla — 2012-04-25T01:43:15Z