Skip to content

Commit

Permalink
Fix move-compiler panic in case of inlined method use in parameter to…
Browse files Browse the repository at this point in the history
… inlined method. (#8867)

Includes test case illustrating original bug (aptos-labs/aptos-core#8516)
plus a number of tests to check corner cases of multiple inlining and recursive inlining.
(Several failed without this fix.)

Also replace panic!("ICE expected function parameter to be a lambda") with a more useful diag
output.

GitOrigin-RevId: ea19ce1b272e5e2e979057bd58990e76e6c4d03a
  • Loading branch information
brmataptos authored and aptos-bot committed Oct 24, 2024
1 parent 90daf72 commit e22c702
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions aptos-stdlib/tests/math64_tests.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#[test_only]
module aptos_std::math64_tests {
use aptos_std::math64;

#[test]
fun test_nested_mul_div() {
let a = math64::mul_div(1, 1, 1);
assert!(math64::mul_div(1, a, 1) == 1, 0);
}

#[test]
fun test_nested_mul_div2() {
assert!(math64::mul_div(1, math64::mul_div(1, 1, 1),1) == 1, 0);
}

#[test]
fun test_nested_mul_div3() {
let a = math64::mul_div(1, math64::mul_div(1, 1, 1),1);
assert!(a == 1, 0);
}
}

0 comments on commit e22c702

Please sign in to comment.