You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now the lj-releng tool will ignore use of Lua global variables with the name matching one of the Lua builtin functions. This will hide those use of global variables on hot Lua code paths, as in
localfunctionfoo (msg)
assert(type(msg) =="string")
print(msg)
end
For this minimal Lua program, the lj-releng would fail to report the use of Lua global variables inside the foo user function, which are assert, type, and print. The "global-clean" form should be
localtype=typelocalassert=assertlocalprint=printlocalfunctionfoo (msg)
assert(type(msg) =="string")
print(msg)
end
Under the hood, lj-releng should only filter builtin function names for bytecodes outside any Lua function bodies. This requires lj-releng to have some knowledge about the specific bytecode sequences used for Lua function prologue and epilogue during the scan.
The text was updated successfully, but these errors were encountered:
This issue seems deprecated. I tried to run lj-releng with the above-mentioned example and it did report all use of globals as expected, or am I missing something?
openresty-devel-utils git:(master) cat test.lua
localfunctionfoo (msg)
assert(type(msg) == "string")
print(msg)
end
openresty-devel-utils git:(master) ./lj-releng -s test.lua
ERROR: test.lua: line 2: getting the Lua global "assert"
ERROR: test.lua: line 2: getting the Lua global "type"
ERROR: test.lua: line 3: getting the Lua global "print"
Right now the
lj-releng
tool will ignore use of Lua global variables with the name matching one of the Lua builtin functions. This will hide those use of global variables on hot Lua code paths, as inFor this minimal Lua program, the
lj-releng
would fail to report the use of Lua global variables inside thefoo
user function, which areassert
,type
, andprint
. The "global-clean" form should beUnder the hood,
lj-releng
should only filter builtin function names for bytecodes outside any Lua function bodies. This requireslj-releng
to have some knowledge about the specific bytecode sequences used for Lua function prologue and epilogue during the scan.The text was updated successfully, but these errors were encountered: