Skip to content

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

@agentzh

Description

@agentzh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions