Bug 23057 – importC: dmd segfault on invalid syntax

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-04-24T23:30:01Z
Last change time
2022-05-05T21:04:21Z
Keywords
ImportC, pull
Assigned to
No Owner
Creator
duser

Comments

Comment #0 by duser — 2022-04-24T23:30:01Z
these 6 characters: (a[0]) Program received signal SIGSEGV, Segmentation fault. 0x0000000000744138 in Type::isTypeSArray() (this=0x0) at src/dmd/mtype.d:2703 2703 inout(TypeSArray) isTypeSArray() { return ty == Tsarray ? cast(typeof(return))this : null; } (gdb) bt #0 in Type::isTypeSArray() (this=0x0) at src/dmd/mtype.d:2703 #1 in dmd.cparse.(...).CParser.cparseDeclarator(...).parseDecl(dmd.mtype.Type) (this=0x7fffffffcc08, t=0x0) at src/dmd/cparse.d:2620 #2 in dmd.cparse.(...).CParser.cparseDeclarator(...).parseDecl(dmd.mtype.Type) (this=0x7fffffffcc08, t=0x0) at src/dmd/cparse.d:2513 #3 in dmd.cparse.(...).CParser.cparseDeclarator(...) (this=0x7fffffffd0e0, specifier=..., pident=@0x7fffffffcd40: 0x7ffff7b666b0, t=0x0, declarator=<incomplete type>) at src/dmd/cparse.d:2666 #4 in dmd.cparse.(...).CParser.cparseDeclaration(dmd.cparse.CParser!(dmd.astcodegen.ASTCodegen).CParser.LVL) (this=0x7fffffffd0e0, level=<incomplete type>) at src/dmd/cparse.d:1669 #5 in dmd.cparse.(...).CParser.parseModule() (this=0x7fffffffd0e0) at src/dmd/cparse.d:128 #6 in dmd.dmodule.Module.parseModule!(dmd.astcodegen.ASTCodegen).parseModule() (this=0x7ffff7b66430) at src/dmd/dmodule.d:963 #7 in Module::parse() (this=0x7ffff7b66430) at src/dmd/dmodule.d:680 #8 in dmd.mars.tryMain(ulong, const(char)**, ref dmd.globals.Param) (params=..., argv=0x7fffffffdd28, argc=2) at src/dmd/mars.d:359 #9 in D main (_param_0=...) at src/dmd/mars.d:958 line numbers at commit 035a9efa1c404c90e5c0140f939cb02d02f1cc15
Comment #1 by bugzilla — 2022-04-29T18:16:52Z
I think this was taken care of in the stable branch.
Comment #2 by bugzilla — 2022-05-01T05:50:57Z
(In reply to Walter Bright from comment #1) > I think this was taken care of in the stable branch. Oh well, it wasn't.
Comment #3 by dlang-bot — 2022-05-01T06:13:19Z
@WalterBright created dlang/dmd pull request #14049 "fix Issue 23057 - importC: dmd segfault on invalid syntax" fixing this issue: - fix Issue 23057 - importC: dmd segfault on invalid syntax https://github.com/dlang/dmd/pull/14049
Comment #4 by dlang-bot — 2022-05-02T08:15:24Z
dlang/dmd pull request #14049 "fix Issue 23057 - importC: dmd segfault on invalid syntax" was merged into stable: - 76fa00ea10c1809a072504aeec9bf5676bd78aa0 by Walter Bright: fix Issue 23057 - importC: dmd segfault on invalid syntax https://github.com/dlang/dmd/pull/14049
Comment #5 by dlang-bot — 2022-05-05T21:04:21Z
dlang/dmd pull request #14064 "merge stable" was merged into master: - 6a0ad49d393eb9ff42fe7b8b0e3ef9bd5264cb55 by Walter Bright: fix Issue 23057 - importC: dmd segfault on invalid syntax (#14049) https://github.com/dlang/dmd/pull/14064