Bug 21691 – premature mangleof can be accessed when pragma mangle calls the function it's applied to

Status
NEW
Severity
minor
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-03-08T21:02:12Z
Last change time
2024-12-13T19:15:02Z
Assigned to
No Owner
Creator
Dennis
See also
https://issues.dlang.org/show_bug.cgi?id=22620
Moved to GitHub: dmd#19882 →

Comments

Comment #0 by dkorpel — 2021-03-08T21:02:12Z
I did not hit this bug in the wild so I'm marking it as only a minor issue, but found this when testing https://github.com/dlang/dmd/pull/12252: ``` pragma(mangle, getFoo()) string getFoo() { pragma(msg, getFoo.mangleof); return "foo"; } pragma(msg, getFoo.mangleof); ``` Output: > _D9onlineapp6getFooFZAya > foo It should raise a forward reference error, but instead a premature .mangleof is printed.
Comment #1 by robert.schadek — 2024-12-13T19:15:02Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19882 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB