-
Notifications
You must be signed in to change notification settings - Fork 12
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
LFVM: Refactor overflow checks, add tests #838
Conversation
1d1693d
to
2cad068
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.
Looks good, and I think it is a clear improvement.
Did you encounter any major trade-offs you needed to make during the refactoring?
TL;DR: There are 2 small details that may require discussion:
|
2cad068
to
b0173fa
Compare
b0173fa
to
969c8f5
Compare
969c8f5
to
7ab6449
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.
Great improvement, thanks!
delay range check for offset and length op parameters instead of doing at the beginning of the instructions to simplify instructions control flow.
7ab6449
to
0dd63cc
Compare
Remove superfluous tests
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 have a couple questions/comments before fully approving
- remove dead code - move word cost after get slice to guard size cast - move global variable to local scope - fix variable naming
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.
thanks for the great changes !!
|
part of #751
This PR removes
checkSizeOffsetUint64Overflow
and rounding done to delay overflow checksThis is done by moving range check for offset and length Op parameters in the memory expansion or getData calls instead of it doing at the beginning of the instructions.
This change simplifies many instructions control flow, and facilitates testing
LFVM has 3 kinds of memory management in the VM, in the sense of manipulating slices that could suffer an out of range access:
Regarding error reporting, these functions behave as follows:
other changes: