Bug 22629 – inlining affects assert messages with -checkaction=C

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2021-12-26T02:40:45Z
Last change time
2024-12-13T19:20:08Z
Assigned to
No Owner
Creator
duser
Moved to GitHub: dmd#18075 →

Comments

Comment #0 by duser — 2021-12-26T02:40:45Z
--- void main() { mydata data; assert(check(&data)); } struct mydata { int a, b, c; } bool check(mydata* p) { return p.a == 1 && p.b == 2 && p.c == 3; } --- % dmd -checkaction=C -run asserttest.d dmd_runzAP3V1: asserttest.d:4: Assertion `check(& data)' failed. % dmd -inline -checkaction=C -run asserttest.d dmd_runJ6qb9y: asserttest.d:12: Assertion `(mydata* p = & data;) , (*p).a == 1 && ((*p).b == 2) && ((*p).c == 3)' failed. two problems with the output: - the line number of the assert statement is replaced with the line number of the inlined code - the original expression in the message is replaced with the inlined function's contents
Comment #1 by robert.schadek — 2024-12-13T19:20:08Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18075 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB