-
Notifications
You must be signed in to change notification settings - Fork 38
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
Validate missing else branch #417
Conversation
Codecov Report
@@ Coverage Diff @@
## master #417 +/- ##
==========================================
+ Coverage 99.32% 99.33% +0.01%
==========================================
Files 50 50
Lines 14075 14169 +94
==========================================
+ Hits 13980 14075 +95
+ Misses 95 94 -1 |
9ef06c0
to
0ef2d6d
Compare
e8db0dc
to
98ae70c
Compare
@gumb0 rebase plase |
0ef2d6d
to
018b7bf
Compare
@@ -468,10 +467,15 @@ parser_result<Code> parse_expr(const uint8_t* pos, const uint8_t* end, FuncIdx f | |||
|
|||
update_result_stack(frame, operand_stack); // else is the end of if. | |||
|
|||
// Reset frame after if. | |||
frame.unreachable = false; |
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 decided here at else
instruction to pop the frame and push a new one instead of overwriting fields in the top one.
This way we can keep both instruction
and immediates_offset
fields const
in ControlFrame
, and it just seems more logical to push a new one, because it's different frame.
But this requires to transfer the contents of br_immediate_offsets
from the old top frame to the new one.
018b7bf
to
b65b462
Compare
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 like this approach. Something more sophisticated may be to create a new frame and then swap with the old one. And also swap br offsets vector. Just a way to hide double move. Not verified. Just napkin level idea.
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 like this approach. Something more sophisticated may be to create a new frame and then swap with the old one. And also swap br offsets vector. Just a way to hide double move. Not verified. Just napkin level idea.
b65b462
to
15eb164
Compare
Depends on #407