-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Fix the evil fallthrough bug #23687
Fix the evil fallthrough bug #23687
Conversation
@swift-ci test |
@swift-ci test compiler performance |
Build failed |
Build failed |
Compilation-performance test failed |
1725d7a
to
55492f1
Compare
@swift-ci test |
@swift-ci test compiler performance |
@swift-ci test source compatibility |
1 similar comment
@swift-ci test source compatibility |
Build failed |
Build failed |
For some reason the performance job is not posting the comment AFAIKT. I got it directly from the bot. It is going to be my next post. |
// If we had any bad redefinitions, we already diagnosed them against the | ||
// first case label item. | ||
if (v->hasName()) | ||
addToScope(v, false /*diagnoseRedefinitions*/); |
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.
Is this always going to be a redefinition?
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.
Yes.
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.
Maybe add a new entry point, like addRedefinitionToScope(), that changes the logic around and asserts if its not a redefinition.
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.
SGTM
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.
Actually that is not what we want. We actually just do not want
to emit the error here. The reason why is that we are not always
going to have a redefinition But in the case where we do have the
redefinition, we only want to emit a single error (the one from
the case label). That is why for the case body decls I have wired
through the flag to ignore the error /if/ it occurs.
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.
@slavapestov ping?
…cls to a specific case stmt var decl.
55492f1
to
6f30bc0
Compare
6f30bc0
to
a307db0
Compare
@swift-ci smoke test and merge |
@swift-ci smoke test and merge |
…attern emission to fix the evil fallthrough bug. rdar://47467128
a307db0
to
7b0d845
Compare
@swift-ci smoke test and merge |
4 similar comments
@swift-ci smoke test and merge |
@swift-ci smoke test and merge |
@swift-ci smoke test and merge |
@swift-ci smoke test and merge |
@gottesmm This is causing heap-use-after-free in internal ASAN bot. rdar://problem/49609717 |
This PR contains two helper PRs that refactor the code slightly and a final last PR that wires up the case body var decl code to SILGenPattern.
rdar://47467128