-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[compiler] Overload Move abort to support messages #18403
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
base: calin/vm-abort-message-2
Are you sure you want to change the base?
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
e16c548 to
9d97287
Compare
vineethk
left a comment
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.
Left some higher level syntax questions in slack. Leaving some comments here too.
third_party/move/move-compiler-v2/transactional-tests/tests/control_flow/abort_msg.move
Outdated
Show resolved
Hide resolved
third_party/move/move-compiler-v2/transactional-tests/tests/control_flow/abort_msg.exp
Outdated
Show resolved
Hide resolved
third_party/move/move-compiler-v2/transactional-tests/tests/control_flow/abort_byte_string.exp
Show resolved
Hide resolved
9d97287 to
8e1d7bf
Compare
8e1d7bf to
aec15df
Compare
vineethk
left a comment
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.
Approving assuming comments are addressed. Looks good!

Description
This extends the Move abort syntax by overloading it to accept either a
u64or avector<u8>, e.g.The latter form emits a
AbortMsginstruction withUNSPECIFIED_ABORT_CODEand the provided message.How Has This Been Tested?
Added several tests in
move-compiler-v2-transactional-tests, such as:abort b"Hello, world!")abort vector[..])Key Areas to Review
Type of Change
Which Components or Systems Does This Change Impact?
Checklist
Note
Adds message-capable abort and propagates it across the toolchain.
AbortKindand changesOperation::Abortto carry kind; bytecode gen emitsBytecode::Abort(code, [msg]); updates visitors/rewriters/checkers (inlining_optimization,seqs_in_binop_checker, spec rewriter, astifier, exp_builder, sourcifier, prover translator, linters) to new shapeabort vector<u8>translated to message abort withUNSPECIFIED_ABORT_CODE(gated on language v2.4); printing/decompile elides unspecified code and showsabort <bytes>VERSION_DEFAULT_LANG_V2_4toVERSION_10; retainsABORT_MSGopcode mappingabortwith byte strings, vectors, blocks, nesting, invalid UTF-8, and round-trip decompilation; updates separate baselines where offsets differWritten by Cursor Bugbot for commit d74255a. This will update automatically on new commits. Configure here.