Bug 24029 – ImportC: symbol name clash on statement expressions
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-07-03T19:39:30Z
Last change time
2023-07-04T08:15:55Z
Keywords
ImportC, pull
Assigned to
No Owner
Creator
Dennis
Comments
Comment #0 by dkorpel — 2023-07-03T19:39:30Z
Found in the test case of https://github.com/dlang/dmd/pull/15375 with multiple asserts. Reduced:
```C
int x = 0;
int y = 0;
void a()
{
(__extension__ ({ x += 2; })); // test.a.__dgliteral1
}
void b()
{
(__extension__ ({ y += 1; })); // test.b.__dgliteral1
}
int main(void)
{
a();
b();
__check(x == 2);
__check(y == 1);
return 0;
}
```
Output:
```
/usr/bin/ld: warning: size of symbol `__dgliteral1' changed from 20 in test.o to 19 in test.o
```
And the test fails. Because it's ImportC, the __dgliteral symbols don't get their function as a prefix in the mangle, so the symbols clash.
Comment #1 by dlang-bot — 2023-07-04T05:38:47Z
@WalterBright created dlang/dmd pull request #15378 "fix Issue 24029 - ImportC: symbol name clash on statement expressions" fixing this issue:
- fix Issue 24029 - ImportC: symbol name clash on statement expressions
https://github.com/dlang/dmd/pull/15378
Comment #2 by dlang-bot — 2023-07-04T08:15:55Z
dlang/dmd pull request #15378 "fix Issue 24029 - ImportC: symbol name clash on statement expressions" was merged into master:
- aa7024012d1d196dbf36b49f0e2982dcb01d247e by Walter Bright:
fix Issue 24029 - ImportC: symbol name clash on statement expressions
https://github.com/dlang/dmd/pull/15378