-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fixed a bug in StmtConditionElement::getSourceRange where it would create invalid source ranges #5323
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
Conversation
…eate invalid source ranges This bug was causing an assert.
else | ||
Start = getPattern()->getStartLoc(); | ||
|
||
SourceLoc End = getInitializer()->getEndLoc(); |
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'm really not happy with this duplicated logic. At this point it probably makes sense to just not implement getStartLoc
and getEndLoc
, right?
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 thought not because of the bool and availability cases, they never need to find the other loc when asked.
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 suppose that's true. In that case, maybe in this case it delegates to getSourceRange
?
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.
Then it would recheck the kind, we could just make a static function for this case.
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.
Inlining should take care of that.
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.
Ok then. I will update it.
… getSourceRange instead
Amended. |
@swift-ci Please smoke test and merge |
1 similar comment
@swift-ci Please smoke test and merge |
Fixed a bug in StmtConditionElement::getSourceRange where it would create invalid source ranges.
This bug was causing an assert. Now it creates valid source ranges.