aboutsummaryrefslogtreecommitdiff
path: root/testes/locals.lua
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-07-12 11:38:42 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-07-12 11:38:42 -0300
commitf6aab3ec1f111cd8d968bdcb7ca800e93b819d24 (patch)
tree4c36c418ecc9062e6d95de73457198b38b0afce9 /testes/locals.lua
parentbe8445d7e4b6122620c428877b51a27d464253d5 (diff)
downloadlua-f6aab3ec1f111cd8d968bdcb7ca800e93b819d24.tar.gz
lua-f6aab3ec1f111cd8d968bdcb7ca800e93b819d24.tar.bz2
lua-f6aab3ec1f111cd8d968bdcb7ca800e93b819d24.zip
First implementation of constant propagation
Local constant variables initialized with compile-time constants are optimized away from the code.
Diffstat (limited to 'testes/locals.lua')
-rw-r--r--testes/locals.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/testes/locals.lua b/testes/locals.lua
index 0de00a98..1b82dd7f 100644
--- a/testes/locals.lua
+++ b/testes/locals.lua
@@ -324,7 +324,7 @@ do
324 324
325 -- errors due to non-closable values 325 -- errors due to non-closable values
326 local function foo () 326 local function foo ()
327 local <toclose> x = 34 327 local <toclose> x = {}
328 end 328 end
329 local stat, msg = pcall(foo) 329 local stat, msg = pcall(foo)
330 assert(not stat and string.find(msg, "variable 'x'")) 330 assert(not stat and string.find(msg, "variable 'x'"))