Bug 23008 – importC: dmd asserts on empty struct or union as global
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2022-04-10T10:19:30Z
Last change time
2022-04-18T13:34:54Z
Keywords
ice, ImportC, pull
Assigned to
No Owner
Creator
duser
Comments
Comment #0 by duser — 2022-04-10T10:19:30Z
struct {} a;
union {} b;
---
ERROR: This is a compiler bug.
Please report it via https://issues.dlang.org/enter_bug.cgi
with, preferably, a reduced, reproducible example and the information below.
DustMite (https://github.com/CyberShadow/DustMite/wiki) can help with the reduction.
---
DMD v2.099.1-339-g863fec775
predefs DigitalMars LittleEndian D_Version2 all D_SIMD Posix ELFv1 linux CRuntime_Glibc CppRuntime_Gcc D_InlineAsm_X86_64 X86_64 D_LP64 D_PIC assert D_PreConditions D_PostConditions D_Invariants D_ModuleInfo D_Exceptions D_TypeInfo D_HardFloat
binary /home/human/work/result/bin/dmd
version v2.099.1-339-g863fec775
config /home/human/work/result/bin/dmd.conf
DFLAGS -I/home/human/work/result/bin/../import -L-L/home/human/work/result/bin/../lib -L--export-dynamic -fPIC
---
core.exception.AssertError@src/dmd/toobj.d(613): Assertion failure
----------------
??:? onAssertError [0x7fcc94168622]
src/dmd/toobj.d:613 _ZN9toObjFile9ToObjFile5visitEP14VarDeclaration [0x55e7ad4e0af6]
src/dmd/declaration.d:1653 _ZN14VarDeclaration6acceptEP7Visitor [0x55e7ad2a9bdb]
src/dmd/toobj.d:748 _ZN9toObjFile9ToObjFile5visitEP17AttribDeclaration [0x55e7ad4e0531]
??:? _ZN16ParseTimeVisitorI10ASTCodegenE5visitEP15LinkDeclaration [0x55e7ad4f14e5]
src/dmd/attrib.d:434 _ZN15LinkDeclaration6acceptEP7Visitor [0x55e7ad2aa15b]
src/dmd/toobj.d:1008 _Z9toObjFileP7Dsymbolb [0x55e7ad2d3831]
src/dmd/glue.d:522 _Z10genObjFileP6Moduleb [0x55e7ad4c64a2]
src/dmd/glue.d:137 void dmd.glue.generateCodeAndWrite(dmd.dmodule.Module[], const(char)*[], const(char)[], const(char)[], bool, bool, bool, bool, bool) [0x55e7ad2e1d58]
src/dmd/mars.d:574 int dmd.mars.tryMain(ulong, const(char)**, ref dmd.globals.Param) [0x55e7ad2e462b]
src/dmd/mars.d:958 _Dmain [0x55e7ad2effcf]
---
line at current commit: https://github.com/dlang/dmd/blob/863fec775e2dd8b8f4788849d7b8923b70dcf279/src/dmd/toobj.d#L613
Comment #1 by dlang-bot — 2022-04-18T07:15:38Z
@WalterBright created dlang/dmd pull request #14007 "fix Issue 23008 - importC: dmd asserts on empty struct or union as gl…" fixing this issue:
- fix Issue 23008 - importC: dmd asserts on empty struct or union as global
https://github.com/dlang/dmd/pull/14007
Comment #2 by dlang-bot — 2022-04-18T13:34:54Z
dlang/dmd pull request #14007 "fix Issue 23008 - importC: dmd asserts on empty struct or union as gl…" was merged into master:
- e88ae5e540760da54d236d75d1339ee281b78dce by Walter Bright:
fix Issue 23008 - importC: dmd asserts on empty struct or union as global
https://github.com/dlang/dmd/pull/14007