Bug 16022 – [REG2.069] dmd assertion failure due to misplaced comma operator
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-05-13T18:42:40Z
Last change time
2017-12-18T22:57:25Z
Keywords
ice, pull
Assigned to
No Owner
Creator
Sebastiaan Koppe
Comments
Comment #0 by mail — 2016-05-13T18:42:40Z
I changed something in my code to:
bool foo()
{
return (
token.type == Type.Colon, // Typo: wanted logical operator instead of comma
token.type == Type.Comma);
}
And I suddenly got this back from dmd:
linkage = 0
Assertion failed: (0), function visit, file tocsym.c, line 246.
dmd failed with exit code -6.
In the function foo I wanted to type || instead of the comma. Regardless, it shouldn't fail with an assertion.
Comment #1 by ag0aep6g — 2016-05-13T18:50:30Z
Complete test case:
----
enum Type {Colon, Comma}
Type type;
bool foo()
{
return type == Type.Colon, type == Type.Comma;
}
----
Compiles with 2.068. Fails with ICE since 2.069.