You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tested on Windows DMD 2081.2 and 2083.0
On Linux 2.065.0 and 2082.0
Compiler segfaults when assigning from a slice to an AA that contains another array in CTFE.
Does not occur if executed at runtime or with a string[string].
---
void main() { enum a = d(); }
auto d() {
alias VP = string[string];
VP[string] values;
string str = "aaaaaa";
values[str]["s"] = "val";
str = str[1..3];values[str]["s"] = "val"; // <-- right here.return values;
}
------
DMD v2.083.0
predefs Have_new DigitalMars Windows CRuntime_DigitalMars CppRuntime_DigitalMars LittleEndian D_Version2 all D_InlineAsm D_InlineAsm_X86 X86 Win32 assert D_ModuleInfo D_Exceptions D_TypeInfo D_HardFloat
binary C:\D\dmd2\windows\bin\dmd.exe
version v2.083.0
config C:\D\dmd2\windows\bin\sc.ini
DFLAGS -IC:\D\dmd2\windows\bin\..\..\src\phobos -IC:\D\dmd2\windows\bin\..\..\src\druntime\import
---
The text was updated successfully, but these errors were encountered:
This is the output I get on run.dlang.io:
Up to 2.060 : Failure with output:
-----
onlineapp.d(4): Error: no identifier for declarator VP
onlineapp.d(4): Error: alias cannot have initializer
-----
Since 2.061 : Success and no output
Maybe close this as invalid?
I'm sorry; I'd removed a writeln on run.dlang.io before posting it here but didn't test it. The writeln isn't necessary when I run it locally.
---
import std.stdio;
void main() { enum a = d(); writeln(a); }
auto d() {
alias VP = string[string];
VP[string] values;
string str = "aaaaaa";
values[str]["s"] = "val";
str = str[1..3];values[str]["s"] = "val"; // <-- right here.return values;
}
---
This does not seem to be a CTFE issue.
It's a problem where the optimizer will try to optimise an invalid node.
Also there is no need to use writeln, you can replace the writeln by void use(A)(A a) {}
Some more information:
What happens is actually a stack-overflow in optimize.d:1209
I guess my guess is that error-nodes do compare false to all other nodes since an error node does make it through. the Optimizer can never verify that the fixed point has been reached.
dlang reported this on 2018-11-19T18:01:54Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=19413
CC List
Description
The text was updated successfully, but these errors were encountered: