aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-01-12 23:14:59 +0800
committerchriseth <chris@ethereum.org>2018-02-06 19:31:43 +0800
commit22c4d282aae4279b37bd3d031b3baade2a3e508b (patch)
treefa20f662875653562983e3ec1ee810b6c47bedf5 /test
parent30e6f69bfd1a6fd907b96060901b0962b1e9cf18 (diff)
downloaddexon-solidity-22c4d282aae4279b37bd3d031b3baade2a3e508b.tar.gz
dexon-solidity-22c4d282aae4279b37bd3d031b3baade2a3e508b.tar.zst
dexon-solidity-22c4d282aae4279b37bd3d031b3baade2a3e508b.zip
Only substitute if all referenced variables are in scope.
Diffstat (limited to 'test')
-rw-r--r--test/libjulia/Rematerialiser.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/libjulia/Rematerialiser.cpp b/test/libjulia/Rematerialiser.cpp
index ae254ad9..020f0020 100644
--- a/test/libjulia/Rematerialiser.cpp
+++ b/test/libjulia/Rematerialiser.cpp
@@ -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()