Bug 20296 – Segfault when using variadic D functions with extern(C++) linkage

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-10-11T07:36:00Z
Last change time
2020-08-18T03:02:00Z
Keywords
ice, pull
Assigned to
No Owner
Creator
Andrej Mitrovic

Comments

Comment #0 by andrej.mitrovich — 2019-10-11T07:36:00Z
----- extern (C++) void foo(T...)(T args) { } alias F = foo!(char*); ----- Tested with v2.088.0 and v2.086.1
Comment #1 by andrej.mitrovich — 2019-10-11T07:41:30Z
It segfaults in the mangler, it seems it has an issue with pointers of any type.
Comment #2 by dlang-bot — 2020-08-16T18:21:22Z
@BorisCarvajal created dlang/dmd pull request #11582 "Fix Issue 20296 - Segfault when using variadic D functions with exter…" fixing this issue: - Fix Issue 20296 - Segfault when using variadic D functions with extern(C++) linkage https://github.com/dlang/dmd/pull/11582
Comment #3 by moonlightsentinel — 2020-08-16T18:31:54Z
This is actually a regression: Up to 2.060 : Status -6 with output: dmd: cppmangle.c:192: virtual void Type::toCppMangle(OutBuffer*, CppMangleState*): Assertion `deco' failed. 2.061 to 2.063 : Success and no output 2.064 to 2.066.0: Segfault and no output 2.067.1 to 2.083.1: Success and no output Since 2.084.1: Segfault and no output
Comment #4 by moonlightsentinel — 2020-08-16T18:33:16Z
(In reply to moonlightsentinel from comment #3) > This is actually a regression: (Found using a modified test case which defines ================================== void main() { foo!(char*)(null); } ================================== instead of an alias.
Comment #5 by boris2.9 — 2020-08-16T22:27:19Z
Yeah, the instance is what's needed.
Comment #6 by dlang-bot — 2020-08-18T03:02:00Z
dlang/dmd pull request #11582 "Fix Issue 20296 - Segfault when using variadic D functions with exter…" was merged into stable: - 86703c21125d4e62529ec60255d5081aab40624e by Boris Carvajal: Fix Issue 20296 - Segfault when using variadic D functions with extern(C++) linkage https://github.com/dlang/dmd/pull/11582