File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -932,16 +932,22 @@ where
932
932
context. start_in_flight_op ( OpInFlight :: new ( Opcode :: While , 1 ) ) ;
933
933
}
934
934
Opcode :: Continue => {
935
- let BlockKind :: While { start_pc } = & context. current_block . kind else {
936
- Err ( AmlError :: ContinueOutsideOfWhile ) ?
937
- } ;
938
- context. current_block . pc = * start_pc;
935
+ if let BlockKind :: While { start_pc } = & context. current_block . kind {
936
+ context. current_block . pc = * start_pc;
937
+ } else {
938
+ loop {
939
+ let Some ( block) = context. block_stack . pop ( ) else {
940
+ Err ( AmlError :: ContinueOutsideOfWhile ) ?
941
+ } ;
942
+ if let BlockKind :: While { start_pc } = block. kind {
943
+ context. current_block . pc = start_pc;
944
+ break ;
945
+ }
946
+ }
947
+ }
939
948
context. start_in_flight_op ( OpInFlight :: new ( Opcode :: While , 1 ) ) ;
940
949
}
941
950
Opcode :: Break => {
942
- /*
943
- * Break out of the innermost `DefWhile`.
944
- */
945
951
if let BlockKind :: While { .. } = & context. current_block . kind {
946
952
context. current_block = context. block_stack . pop ( ) . unwrap ( ) ;
947
953
} else {
@@ -950,10 +956,10 @@ where
950
956
Err ( AmlError :: BreakOutsideOfWhile ) ?
951
957
} ;
952
958
if let BlockKind :: While { .. } = block. kind {
959
+ context. current_block = context. block_stack . pop ( ) . unwrap ( ) ;
953
960
break ;
954
961
}
955
962
}
956
- context. current_block = context. block_stack . pop ( ) . unwrap ( ) ;
957
963
}
958
964
}
959
965
Opcode :: Return => context. start_in_flight_op ( OpInFlight :: new ( Opcode :: Return , 1 ) ) ,
You can’t perform that action at this time.
0 commit comments