D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 16022 - [REG2.069] dmd assertion failure due to misplaced comma operator
Summary: [REG2.069] dmd assertion failure due to misplaced comma operator
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords: ice, pull
Depends on:
Blocks:
 
Reported: 2016-05-13 18:42 UTC by Sebastiaan Koppe
Modified: 2017-12-18 22:57 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Sebastiaan Koppe 2016-05-13 18:42:40 UTC
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 ag0aep6g 2016-05-13 18:50:30 UTC
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.
Comment 2 Kenji Hara 2016-05-13 22:24:40 UTC
https://github.com/dlang/dmd/pull/5774
Comment 3 github-bugzilla 2016-05-14 20:54:14 UTC
Commits pushed to stable at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/dd3e980ca418b15d0e508ed3506276040f71e774
fix Issue 16022 - dmd assertion failure due to misplaced comma operator

https://github.com/dlang/dmd/commit/35190b070e3dee5ba0ba07533a0a9f476b20ffa4
Merge pull request #5774 from 9rnsr/fix16022

[REG2.069] Issue 16022 - dmd assertion failure due to misplaced comma operator
Comment 4 github-bugzilla 2016-05-16 02:51:32 UTC
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/dd3e980ca418b15d0e508ed3506276040f71e774
fix Issue 16022 - dmd assertion failure due to misplaced comma operator

https://github.com/dlang/dmd/commit/35190b070e3dee5ba0ba07533a0a9f476b20ffa4
Merge pull request #5774 from 9rnsr/fix16022
Comment 5 github-bugzilla 2017-11-20 08:41:55 UTC
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/64980c29006945d9b0a5abbe096edd2c92913584
Issue 16022 - assertion failure due to misplaced comma operator (additional test)

https://github.com/dlang/dmd/commit/f6c2fbf2925326f47809eda4a999b8722d12d547
Merge pull request #7338 from JinShil/fix_16022

Issue 16022 - assertion failure due to misplaced comma operator (additional test)
merged-on-behalf-of: Iain Buclaw <ibuclaw@gdcproject.org>
Comment 6 github-bugzilla 2017-12-18 22:57:25 UTC
Commits pushed to stable at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/64980c29006945d9b0a5abbe096edd2c92913584
Issue 16022 - assertion failure due to misplaced comma operator (additional test)

https://github.com/dlang/dmd/commit/f6c2fbf2925326f47809eda4a999b8722d12d547
Merge pull request #7338 from JinShil/fix_16022