-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[script-composer] Add infer functionality, fix multiple return values #15438
[script-composer] Add infer functionality, fix multiple return values #15438
Conversation
⏱️ 1h 14m total CI duration on this PR
🚨 1 job on the last run was significantly faster/slower than expected
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
c573176
to
7f016d4
Compare
script | ||
.code | ||
.code | ||
.push(Bytecode::StLoc((arg + parameters_count) as u8)); | ||
.push(Bytecode::StLoc((*arg + parameters_count) as u8)); |
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.
Although not part of this PR, do we check for "returns + parameters < 255", or does that happen later when running the script?
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.
It will be checked by the bytecode verifier. But I added a check so that the user can be prompted earlier and not having to see the lengthy bytecode verifier error.
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.
@runtian-zhou There are a bunch of as u*
casts in this file, but it is not clear if all of those are safe casts. E.g., num_of_calls
unconditionally cast to u16.
For example, in the case above, without the check for u8::MAX
, the value would get silently truncated and have incorrect code generated. It is likely that something downstream (like the bytecode verifier) would catch it, but might be good to add checks here in the builder (unless some of these are checked earlier somewhere).
7f016d4
to
8994fd1
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
Description
Fixes two issues for the script composer:
How Has This Been Tested?
Added three test cases:
Key Areas to Review
Whether we tested the two features sufficiently.
Type of Change
Which Components or Systems Does This Change Impact?
Checklist