Skip to content

Commit ad54d9f

Browse files
calintatCalin Tataru
authored andcommitted
Cursor feedback
1 parent 1af6390 commit ad54d9f

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

third_party/move/move-binary-format/src/file_format.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3060,7 +3060,10 @@ pub enum Bytecode {
30603060
stack >> (error_code: u64)
30613061
abort transaction with error_code and error_message
30623062
"#]
3063-
#[runtime_check_prologue = "ty_stack >> _"]
3063+
#[runtime_check_prologue = r#"
3064+
ty_stack >> _
3065+
ty_stack >> _
3066+
"#]
30643067
AbortMsg,
30653068
}
30663069

third_party/move/move-model/bytecode/src/astifier.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -614,9 +614,10 @@ impl Generator {
614614
match ctx.code_for_block(blk).last() {
615615
None => 0,
616616
Some(Abort(..)) => 1,
617-
Some(Jump(..)) => 2,
618-
Some(Branch(..)) => 3,
619-
Some(Ret(..)) => 4,
617+
Some(AbortMsg(..)) => 2,
618+
Some(Jump(..)) => 3,
619+
Some(Branch(..)) => 4,
620+
Some(Ret(..)) => 5,
620621
_ => panic!("unexpected block terminator"),
621622
}
622623
};
@@ -969,6 +970,7 @@ impl Generator {
969970
ExpData::LoopCont(..)
970971
| ExpData::Return(..)
971972
| ExpData::Call(_, Operation::Abort, ..)
973+
| ExpData::Call(_, Operation::AbortMsg, ..)
972974
);
973975
if needs_break {
974976
stms.push(ctx.builder.break_(&self.current_loc(ctx), 0))
@@ -1931,6 +1933,7 @@ impl IfElseTransformer<'_> {
19311933
ExpData::LoopCont(..)
19321934
| ExpData::Return(..)
19331935
| ExpData::Call(_, Operation::Abort, _)
1936+
| ExpData::Call(_, Operation::AbortMsg, _)
19341937
)
19351938
})
19361939
.unwrap_or(stmts.len());
@@ -2912,7 +2915,10 @@ where
29122915
fn is_terminator(&self, exp: &ExpData) -> bool {
29132916
matches!(
29142917
exp,
2915-
ExpData::LoopCont(..) | ExpData::Return(..) | ExpData::Call(_, Operation::Abort, ..)
2918+
ExpData::LoopCont(..)
2919+
| ExpData::Return(..)
2920+
| ExpData::Call(_, Operation::Abort, ..)
2921+
| ExpData::Call(_, Operation::AbortMsg, ..)
29162922
)
29172923
}
29182924

third_party/move/move-model/bytecode/src/stackless_bytecode.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,10 @@ impl Bytecode {
561561
pub fn is_exit(&self) -> bool {
562562
matches!(
563563
self,
564-
Bytecode::Ret(..) | Bytecode::Abort(..) | Bytecode::Call(_, _, Operation::Stop, _, _)
564+
Bytecode::Ret(..)
565+
| Bytecode::Abort(..)
566+
| Bytecode::AbortMsg(..)
567+
| Bytecode::Call(_, _, Operation::Stop, _, _)
565568
)
566569
}
567570

@@ -575,6 +578,7 @@ impl Bytecode {
575578
Bytecode::Ret(..)
576579
| Bytecode::Jump(..)
577580
| Bytecode::Abort(..)
581+
| Bytecode::AbortMsg(..)
578582
| Bytecode::Branch(..)
579583
| Bytecode::Call(_, _, Operation::Stop, _, _)
580584
)

0 commit comments

Comments
 (0)