[Issue 19639] Initializing static array with slice enum of different length crashes the compiler

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Feb 2 21:06:35 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=19639

Neia Neutuladh <dhasenan at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
                 CC|                            |dhasenan at gmail.com

--- Comment #1 from Neia Neutuladh <dhasenan at gmail.com> ---
It's a segfault, to be more specific.

Stacktrace:
__memmove_sse2_unaligned_erms () at
../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:332
332     ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: Dosiero aŭ
dosierujo ne ekzistas.
(gdb) bt
#0  __memmove_sse2_unaligned_erms () at
../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:332
#1  0x00005555557d5621 in castTo::CastTo::visit(StringExp*)
(this=0x7fffffffb230, e=0x555555e12100) at dmd/dcast.d:1863
#2  0x0000555555843096 in StringExp::accept(Visitor*) (this=0x555555e12100,
v=0x7fffffffb230) at dmd/expression.d:2587
#3  0x00005555557d45ff in
_D3dmd5dcast6castToFCQt10expression10ExpressionPSQBv6dscope5ScopeCQCm5mtype4TypeZQCj
(t=0x7ffff6b01790, 
    sc=0x7ffff682d620, e=0x555555e12100) at dmd/dcast.d:2574
#4  0x000055555583f3c9 in Expression::castTo(Scope*, Type*)
(this=0x555555e12100, sc=0x7ffff682d620, t=0x7ffff6b01790) at
dmd/expression.d:923
#5  0x00005555557d1786 in implicitCastTo::ImplicitCastTo::visit(Expression*)
(this=0x7fffffffb3e0, e=0x555555e12100) at dmd/dcast.d:124
#6  0x00005555557d18b9 in implicitCastTo::ImplicitCastTo::visit(StringExp*)
(this=0x7fffffffb3e0, e=0x555555e12100) at dmd/dcast.d:157
#7  0x0000555555843096 in StringExp::accept(Visitor*) (this=0x555555e12100,
v=0x7fffffffb3e0) at dmd/expression.d:2587

I wasn't able to get this to work with other types of arrays. Changing from
"\0" to [cast(immutable)'\0'] also made the problem go away.

--


More information about the Digitalmars-d-bugs mailing list