GithubHelp home page GithubHelp logo

openresty-devel-utils's Issues

lua-releng: luac never see SETGLOBAL or GETGLOBAL

lua-releng output:

test.lua: 0.0.1 (0.0.1)
Checking use of Lua global variables in file test.lua...
    op no.  line    instruction args    ; code
Checking line length exceeding 80...

my test.lua file:

local _M = { version = "0.0.1" }
function _M.test()
  local l = "local"
  g = l
  print(l, g)
  gg = {}
end
return _M

we can see g and gg are both gobal variables...

lj-releng: avoid filtering Lua builtin function names inside user Lua function bodies

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

local function foo (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

local type = type
local assert = assert
local print = print

local function foo (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.

can't use lua-releng with find command recursively

I have a folder named lualib, when cd that folder, I run find . -name '*.lua' | lua-releng -s -e -L, lua-releng won't check files in subfolder such as lualib/db/mysql.lua. I know this because I set some global variables in subfolder on purpose. Am I wrong? Or what's the right way if I want to recursively check all lua files in some folder?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.