Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

Commit

Permalink
[move-compiler] Fixed abstract interpreter bug with continue statement (
Browse files Browse the repository at this point in the history
#1069)

continue in while loop causes an unexpected error.

Cherry-pick: MystenLabs/sui#13349
Bugfix: #1068
  • Loading branch information
ksolana authored Aug 12, 2023
1 parent ee12000 commit 9cf5a04
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions language/move-compiler/src/cfgir/absint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,14 @@ pub trait AbstractInterpreter: TransferFunctions {
// the same post
}
JoinResult::Changed => {
// Pre has changed, the post condition is now unknown for the block
next_block_invariant.post = BlockPostcondition::Unprocessed;
// If the cur->successor is a back edge, jump back to the beginning
// of the loop, instead of the normal next block
if cfg.is_back_edge(block_label, *next_block_id) {
next_block_candidate = Some(*next_block_id);
break;
}
// Pre has changed, the post condition is now unknown for the block
next_block_invariant.post = BlockPostcondition::Unprocessed
}
}
}
Expand Down

0 comments on commit 9cf5a04

Please sign in to comment.