Skip to content

Commit

Permalink
Fix wrong line number in debug code for function call
Browse files Browse the repository at this point in the history
Reported in github issue #34
  • Loading branch information
franko committed Mar 24, 2017
1 parent 6e41eb9 commit 9f3bfe1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lang/generator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ ExpressionRule.FunctionDeclaration = ExpressionRule.FunctionExpression
local function emit_call_expression(self, node, want, use_tail, use_self)
local free = self.ctx.freereg

local call_line = node.line
if use_self then
local obj = self:expr_toanyreg(node.receiver)
self.ctx:op_move(free + 1, obj)
Expand Down Expand Up @@ -440,6 +441,7 @@ local function emit_call_expression(self, node, want, use_tail, use_self)
self.ctx:op_call(free, want, narg)
end
end
self.ctx:setpcline(call_line)

return want == MULTIRES, use_tail
end
Expand Down

0 comments on commit 9f3bfe1

Please sign in to comment.