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
AVM: Track Scratch Slot Types #4064
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4064 +/- ##
==========================================
+ Coverage 54.39% 54.40% +0.01%
==========================================
Files 391 391
Lines 48570 48594 +24
==========================================
+ Hits 26418 26436 +18
- Misses 19929 19936 +7
+ Partials 2223 2222 -1
Continue to review full report at Codecov.
|
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.
Looks good to me. I'd like @michaeldiamant to have a look on Monday when he comes back as I think he's the only other person who has looked at ProgramKnowledge.
Co-authored-by: Michael Diamant <michaeldiamant@users.noreply.github.com>
Refactor scratchSpace initialization into newOpStream
Summary
This PR will allow us to error on things of the sort:
"byte 0x01; store 0; int 1; load 0; +"
by keeping track of the scratch space as we assemble the program within each basic block.
Test Plan
Load/Store: Tested to make sure a load in the first block puts a uint64 on the stack and that load puts the type of whatever was last stored in that slot if a store was done in that block
Loads/Stores: Added test for loads when all the slots are the same type and put in a test for stores which makes sure it only sets slots to StackAny if the type is not the same as what's on the stack