New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 10341 - ICE on case-range statement without an associated switch statement #2167
Conversation
if (sw == NULL) | ||
{ | ||
error("case range not in switch statement"); | ||
return statement; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't seem to return this
here, it just segfaults at a different location. For expressions I can usually return new ErrorExp()
, but we don't seem to have an equivalent for statements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I plan to eventually create an ErrorStatement, but haven't done so yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could possibly use an empty CompoundStatement as a no-op statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like so?:
if (sw == NULL)
{
error("case range not in switch statement");
return new CompoundStatement(loc, new Statements());
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so. Alternatively, some statements return NULL if they are removed by semantic, like static ifs/asserts that are not triggered. This should work at least in theory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning NULL
seems to work too. I'll give it a go and see what the tester says.
LGTM. |
Issue 10341 - ICE on case-range statement without an associated switch statement
Mmm, Currently, the following error has occurred frequently on Linux platform in Auto-tester.
I'm really not sure what's wrong, but from the circumstance merging this pull request is the most doubtful. |
@9rnsr I see no relationship between case range statement and dmd's inability to find object.d. You have reverted the pull, but failures still occur. |
@mxfm Right... |
Sorry abut those tester errors.. entirely my fault. Ignore them. I've deprecated all the tests from that build host so those tests are being re-run. |
@9rnsr: Should I reopen this pull? |
Issue 10341 - ICE on case-range statement without an associated switch statement ----- I confirmed that the change was entirely unrelated to the auto-tester failures. So I re-merge this.
@braddr Thanks, I confirmed. |
http://d.puremagic.com/issues/show_bug.cgi?id=10341