-
-
Notifications
You must be signed in to change notification settings - Fork 825
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: raise UNREACHABLE #3194
Merged
charles-cooper
merged 12 commits into
vyperlang:master
from
emc415:fix/raise_unreachable
Jan 16, 2023
Merged
fix: raise UNREACHABLE #3194
Changes from 8 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
af12adf
wip: fix raise UNREACHABLE issue #3070
emc415 3164502
simplified parse_Raise: pass 0 instead of None as condition to _asser…
emc415 882c35e
Added handling to vyper/ir/compile_ir.py to handle raise_unreachable
emc415 51dce27
Merge branch 'vyperlang:master' into fix/raise_unreachable
emc415 3ff7cf4
changed codegen/stmt.py to emit "invalid" instead of "raise_unreachable"
emc415 1cf6f2f
moved raise UNREACHABLE handling to _assert_reason so that all UNREAC…
emc415 7593b03
replacing vestigial "assure" in the codebase with current "unreachable"
emc415 66e57e8
changed the logic in _assert_reason so that AST is no longer being mo…
emc415 428789f
added variable is_raise to factor out test_expr is None
emc415 c12c372
formatted comment with linter
emc415 570792f
Added test_raise_unreachable
emc415 d4a14af
remove redundant assert
charles-cooper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nice -- since this check is performed twice, and it's actually not entirely clear what the check is for, i would factor out the expression (
test_expr is None
) into a variable calledis_raise
and add a comment about what it is doing.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.
Cool! Is it possible that None can be passed into parse_Assert from an internal compiler assert? I am just thinking that if so, it may be a little misleading if it got called 'is_raise', but also it shouldn't affect behavior.
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.
no,
parse_Assert
only handles user asserts -- but if you are paranoid (which is not a bad thing!) you can add a sanity check inparse_Assert
on the test expr before passing down intoassert_reason()
.