-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Fixes [SR-78] swift compiler seg fault #293
Conversation
Fixes a segmentation fault where the IRGen module would crash when a generic (empty) struct was part of the source code because it tried to call std::next on an end iterator.
Updates to check for empty instead of checking iterator at end() for more readability.
@jckarter: can you review this? |
As the return value for this new use case (when the iterator is exhausted) is the same as when there are multiple stored properties, I would handle these in the same code path - more specifically: the only special case here is when there is a single stored property and everything else should use the main code path. |
Refactored the code so that there is only a single branch for when there is one stored property and the rest return a SILType() as per @simonmpilkington suggestion.
} | ||
|
||
struct Bar { | ||
} |
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.
Empty end line is missing.
LGTM. Add the missing newline like @blackrain suggested and I'll accept. |
@jckarter I added the newline. |
Perfect. Thanks @manavgabhawala! |
Fixes [SR-78] swift compiler seg fault
Reapply "Fix compilation warnings in extended test suite".
Fix builder factory to handle Swift version 4.2 correctly
Fixes SR-78 swift compiler segmentation fault. The IRGen module would crash when a generic (empty) struct was part of the source code because it tried to call std::next on an end iterator, adds in a guard to prevent against that and also adds a test case to add in this check.
Added test case that caused the old compiler to crash (I'm not sure if this is the right way to integrate it in the testing suite).