mirror of
https://github.com/lua/lua
synced 2026-09-27 00:28:25 +03:00
First implementation of constant propagation
Local constant variables initialized with compile-time constants are optimized away from the code.
This commit is contained in:
parent
be8445d7e4
commit
f6aab3ec1f
12 changed files with 249 additions and 119 deletions
|
|
@ -324,7 +324,7 @@ do
|
|||
|
||||
-- errors due to non-closable values
|
||||
local function foo ()
|
||||
local <toclose> x = 34
|
||||
local <toclose> x = {}
|
||||
end
|
||||
local stat, msg = pcall(foo)
|
||||
assert(not stat and string.find(msg, "variable 'x'"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue