[Issue 20235] New: C++ ABI doesn't destruct struct arguments in the callee
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Sep 21 17:58:57 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=20235
Issue ID: 20235
Summary: C++ ABI doesn't destruct struct arguments in the
callee
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: sahmi.soulaimane at gmail.com
C++ doesn't call the destructor or value parameters in the callee.
C++:
```
struct S { ~S(){} };
void fuc(S)
{
}
```
https://cpp.godbolt.org/z/NJt_5s
No call to the destructor.
D:
```
extern(C++):
struct S { ~this(){} }
void fuc(S)
{
}
```
https://d.godbolt.org/z/5yzcFS
It calls the destructor.
This causes some double free bugs.
--
More information about the Digitalmars-d-bugs
mailing list