Bug 1530 – Aliasing problem in DMD front end code

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2007-09-23T12:39:00Z
Last change time
2015-06-09T01:14:16Z
Assigned to
bugzilla
Creator
dvdfrdmn

Comments

Comment #0 by dvdfrdmn — 2007-09-23T12:39:49Z
The following code in Parser::parseDeclarator does not follow C++ aliasing rules(?). It will malfunction when compiled by g++ 4.1.2. TypeNext *ta = new TypeFunction(arguments, t, varargs, linkage); TypeNext **pt; for (pt = (TypeNext **)&ts; *pt != t; pt = (TypeNext **)&(*pt)->next) ; *pt = ta; Suggest: Type *ta = new TypeFunction(arguments, t, varargs, linkage); Type **pt; for (pt = &ts; *pt != t; pt = &((TypeNext*)*pt)->next) ; *pt = ta;
Comment #1 by braddr — 2007-10-20T04:28:03Z
Fixed in 1.022/2.005 (though only listed in the 2.005 change log currently)