Created
November 19, 2015 16:47
-
-
Save tst2005/f6cb49e115671373eb61 to your computer and use it in GitHub Desktop.
safe bytecode, unsafe reusable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local bytecode | |
do | |
local A="a" | |
local f1 = function() | |
return A | |
end | |
bytecode = string.dump(f1) | |
end | |
local env = {} | |
local f2 = load(bytecode, "", "b", env) | |
print( f2() == env) -- true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment