November 06 [Issue 24845] New: Compiler error when trying to access AA value of an enum instance | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24845 Issue ID: 24845 Summary: Compiler error when trying to access AA value of an enum instance Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: major Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: info@lapyst.by When compiling following code on the master (commit ccd589dd6c): ```d enum Maps : int[string] { Some = ["aa" : 12], Other = ["bb" : 24] } void main() { Maps.Some["zz"] = 44; } `` the compiler crashes with the following message: ``` e.Eoper: '&' el:0x55555620d0f0 cnt=0 cs=0 & TY* 0x555556206aa0 el:0x555556206aa0 cnt=0 cs=0 call TY* 0x55555620a0f0 0x5555562052c0 el:0x55555620a0f0 cnt=0 cs=0 var TYC func _d_assocarrayliteralTX el:0x5555562052c0 cnt=0 cs=0 param TYvoid 0x5555560e3bd0 0x5555560e53f0 el:0x5555560e3bd0 cnt=0 cs=0 param TYvoid 0x555556200a20 0x55555620bfe0 el:0x555556200a20 cnt=0 cs=0 rpair TYucent 0x5555561a1fc0 0x555556201400 el:0x5555561a1fc0 cnt=0 cs=0 relconst TY* 0+& _TMP9 el:0x555556201400 cnt=0 cs=0 const TYulong 1LL el:0x55555620bfe0 cnt=0 cs=0 rpair TYucent 0x55555620c9f0 0x55555620e150 el:0x55555620c9f0 cnt=0 cs=0 relconst TY* 0+& _TMP8 el:0x55555620e150 cnt=0 cs=0 const TYulong 1LL el:0x5555560e53f0 cnt=0 cs=0 var TY* _D14TypeInfo_HAyai6__initZ --- 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.105.2-1676-gccd589dd6c predefs DigitalMars LittleEndian D_Version2 all D_SIMD Posix ELFv1 linux CRuntime_Glibc CppRuntime_GNU 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/mai/projects/dlang/dmd/generated/linux/release/64/dmd version v2.105.2-1676-gccd589dd6c config /home/mai/projects/dlang/dmd/generated/linux/release/64/dmd.conf DFLAGS -I/home/mai/projects/dlang/dmd/generated/linux/release/64/../../../../druntime/import -I/home/mai/projects/dlang/dmd/generated/linux/release/64/../../../../../phobos -L-L/home/mai/projects/dlang/dmd/generated/linux/release/64/../../../../../phobos/generated/linux/release/64 -L--export-dynamic -fPIC --- core.exception.AssertError@src/dmd/backend/cgcs.d(431): Assertion failure ---------------- ??:? _d_assertp [0x555555c91948] src/dmd/backend/cgcs.d:431 nothrow @trusted void dmd.backend.cgcs.ecom(ref dmd.backend.cgcs.CGCS, ref dmd.backend.el.elem*) [0x555555baf289] src/dmd/backend/cgcs.d:369 nothrow @trusted void dmd.backend.cgcs.ecom(ref dmd.backend.cgcs.CGCS, ref dmd.backend.el.elem*) [0x555555baf0d3] src/dmd/backend/cgcs.d:369 nothrow @trusted void dmd.backend.cgcs.ecom(ref dmd.backend.cgcs.CGCS, ref dmd.backend.el.elem*) [0x555555baf0d3] src/dmd/backend/cgcs.d:364 nothrow @trusted void dmd.backend.cgcs.ecom(ref dmd.backend.cgcs.CGCS, ref dmd.backend.el.elem*) [0x555555baf0a2] src/dmd/backend/cgcs.d:327 nothrow @trusted void dmd.backend.cgcs.ecom(ref dmd.backend.cgcs.CGCS, ref dmd.backend.el.elem*) [0x555555baf003] src/dmd/backend/cgcs.d:271 nothrow @trusted void dmd.backend.cgcs.ecom(ref dmd.backend.cgcs.CGCS, ref dmd.backend.el.elem*) [0x555555baed5c] src/dmd/backend/cgcs.d:368 nothrow @trusted void dmd.backend.cgcs.ecom(ref dmd.backend.cgcs.CGCS, ref dmd.backend.el.elem*) [0x555555baf0bf] src/dmd/backend/cgcs.d:302 nothrow @trusted void dmd.backend.cgcs.ecom(ref dmd.backend.cgcs.CGCS, ref dmd.backend.el.elem*) [0x555555baeeae] src/dmd/backend/cgcs.d:368 nothrow @trusted void dmd.backend.cgcs.ecom(ref dmd.backend.cgcs.CGCS, ref dmd.backend.el.elem*) [0x555555baf0bf] src/dmd/backend/cgcs.d:271 nothrow @trusted void dmd.backend.cgcs.ecom(ref dmd.backend.cgcs.CGCS, ref dmd.backend.el.elem*) [0x555555baed5c] src/dmd/backend/cgcs.d:368 nothrow @trusted void dmd.backend.cgcs.ecom(ref dmd.backend.cgcs.CGCS, ref dmd.backend.el.elem*) [0x555555baf0bf] src/dmd/backend/cgcs.d:369 nothrow @trusted void dmd.backend.cgcs.ecom(ref dmd.backend.cgcs.CGCS, ref dmd.backend.el.elem*) [0x555555baf0d3] src/dmd/backend/cgcs.d:116 nothrow @trusted void dmd.backend.cgcs.comsubs2(dmd.backend.cc.block*, ref dmd.backend.cgcs.CGCS, ref dmd.backend.goh.GlobalOptimizer) [0x555555bae944] src/dmd/backend/cgcs.d:49 nothrow @trusted void dmd.backend.cgcs.comsubs(ref dmd.backend.goh.GlobalOptimizer) [0x555555bae809] src/dmd/backend/blockopt.d:483 nothrow @trusted void dmd.backend.blockopt.blockopt(ref dmd.backend.goh.GlobalOptimizer, int) [0x555555bb0793] src/dmd/backend/dout.d:1011 nothrow @trusted void dmd.backend.dout.writefunc2(dmd.backend.cc.Symbol*, ref dmd.backend.goh.GlobalOptimizer) [0x555555b93ec9] src/dmd/backend/dout.d:856 nothrow @trusted void dmd.backend.dout.writefunc(dmd.backend.cc.Symbol*) [0x555555b93889] src/dmd/glue.d:968 void dmd.glue.FuncDeclaration_toObjFile(dmd.func.FuncDeclaration, bool) [0x555555b2d475] src/dmd/toobj.d:330 _ZN9toObjFile9ToObjFile5visitEP15FuncDeclaration [0x555555b483dd] src/dmd/func.d:1051 _ZN15FuncDeclaration6acceptEP7Visitor [0x555555a2d2f1] src/dmd/toobj.d:1043 void dmd.toobj.toObjFile(dmd.dsymbol.Dsymbol, bool) [0x555555b48344] src/dmd/glue.d:1417 void dmd.glue.genObjFile(dmd.dmodule.Module, bool) [0x555555b2f16a] src/dmd/glue.d:337 void dmd.glue.generateCodeAndWrite(dmd.dmodule.Module[], const(char)*[], const(char)[], const(char)[], bool, bool, bool, bool, bool) [0x555555b2b6e6] src/dmd/main.d:729 int dmd.main.tryMain(ulong, const(char)**, ref dmd.globals.Param) [0x55555592e0fb] src/dmd/main.d:142 _Dmain [0x55555592c53c] ``` -- |
Copyright © 1999-2021 by the D Language Foundation