Skip to content

Commit

Permalink
fix(compiler): Fix "binary string: bad code in precompiled chunk" bug…
Browse files Browse the repository at this point in the history
… when vararg was used in main chunk
  • Loading branch information
bytexenon committed Jul 6, 2024
1 parent 95d2751 commit 5330c84
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions the-tiny-lua-compiler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2006,6 +2006,7 @@ function InstructionGenerator.generate(ast)
--// MAIN //--
local function generate()
local proto = newProto()
proto.isVarArg = true
processCodeBlock(ast)
-- OP_RETURN [A, B] return R(A), ... ,R(A+B-2)
addInstruction("RETURN", 0, 1) -- Default return statement
Expand Down

0 comments on commit 5330c84

Please sign in to comment.