From db457117e3fc47e0460de067a319254c08f26926 Mon Sep 17 00:00:00 2001 From: Ian Farmer Date: Mon, 2 Jun 2008 04:04:31 +0000 Subject: [PATCH] Change getCurrentPc: this fixes the line number difference in testModule. --- src/core/org/luaj/vm/LuaState.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/org/luaj/vm/LuaState.java b/src/core/org/luaj/vm/LuaState.java index 8d01fa6b..cf638be9 100644 --- a/src/core/org/luaj/vm/LuaState.java +++ b/src/core/org/luaj/vm/LuaState.java @@ -1022,8 +1022,8 @@ public class LuaState extends Lua { * @return the current program counter for the given call frame. */ protected int getCurrentPc(CallInfo ci) { - int pc = (ci != calls[cc] ? ci.pc - 1 : ci.pc); - return pc; + int pc = ci.pc; + return pc > 0 ? pc - 1 : 0; } protected String getSourceFileName(LString source) {