@@ -3050,6 +3050,18 @@ pub enum Bytecode {
30503050 ty_stack << ty
30513051 "# ]
30523052 Negate ,
3053+
3054+ #[ group = "control_flow" ]
3055+ #[ description = r#"
3056+ Abort the transaction with an error code and message.
3057+ "# ]
3058+ #[ semantics = r#"
3059+ stack >> (error_message: &vector<u8>)
3060+ stack >> (error_code: u64)
3061+ abort transaction with error_code and error_message
3062+ "# ]
3063+ #[ runtime_check_prologue = "ty_stack >> _" ]
3064+ AbortMsg ,
30533065}
30543066
30553067impl :: std:: fmt:: Debug for Bytecode {
@@ -3149,6 +3161,7 @@ impl ::std::fmt::Debug for Bytecode {
31493161 Bytecode :: Le => write ! ( f, "Le" ) ,
31503162 Bytecode :: Ge => write ! ( f, "Ge" ) ,
31513163 Bytecode :: Abort => write ! ( f, "Abort" ) ,
3164+ Bytecode :: AbortMsg => write ! ( f, "AbortMsg" ) ,
31523165 Bytecode :: Nop => write ! ( f, "Nop" ) ,
31533166 Bytecode :: Exists ( a) => write ! ( f, "Exists({:?})" , a) ,
31543167 Bytecode :: ExistsGeneric ( a) => write ! ( f, "ExistsGeneric({:?})" , a) ,
@@ -3171,7 +3184,10 @@ impl ::std::fmt::Debug for Bytecode {
31713184impl Bytecode {
31723185 /// Return true if this bytecode instruction always branches
31733186 pub fn is_unconditional_branch ( & self ) -> bool {
3174- matches ! ( self , Bytecode :: Ret | Bytecode :: Abort | Bytecode :: Branch ( _) )
3187+ matches ! (
3188+ self ,
3189+ Bytecode :: Ret | Bytecode :: Abort | Bytecode :: AbortMsg | Bytecode :: Branch ( _)
3190+ )
31753191 }
31763192
31773193 /// Return true if the branching behavior of this bytecode instruction depends on a runtime
@@ -3328,6 +3344,7 @@ impl Bytecode {
33283344 | Le
33293345 | Ge
33303346 | Abort
3347+ | AbortMsg
33313348 | Nop
33323349 | ImmBorrowVariantField ( _)
33333350 | ImmBorrowVariantFieldGeneric ( _)
0 commit comments