Only substitute if all referenced variables are in scope.

This commit is contained in:
chriseth
2018-02-06 12:31:43 +01:00
parent 30e6f69bfd
commit 22c4d282aa
3 changed files with 68 additions and 2 deletions
+9
View File
@@ -126,4 +126,13 @@ BOOST_AUTO_TEST_CASE(reassignment)
);
}
BOOST_AUTO_TEST_CASE(do_not_move_out_of_scope)
{
// Cannot replace by `let b := x` by `let b := a` since a is out of scope.
CHECK(
"{ let x { let a := sload(0) x := a } let b := x }",
"{ let x { let a := sload(0) x := a } let b := x }"
);
}
BOOST_AUTO_TEST_SUITE_END()