From a159a50cee9573b7bd390f74fcd55afb9aac0c36 Mon Sep 17 00:00:00 2001 From: James Roseborough Date: Fri, 10 Apr 2009 00:35:23 +0000 Subject: [PATCH] Save and restore call counter for calls, since they may fail and leave elements on the stack when an Exception is thrown. --- src/core/org/luaj/vm/LuaState.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/org/luaj/vm/LuaState.java b/src/core/org/luaj/vm/LuaState.java index 440f4e55..a5bd29ea 100644 --- a/src/core/org/luaj/vm/LuaState.java +++ b/src/core/org/luaj/vm/LuaState.java @@ -313,6 +313,7 @@ public class LuaState extends Lua { // save stack state int oldbase = base; + int oldcc = cc; try { // rb is base of new call frame @@ -341,6 +342,7 @@ public class LuaState extends Lua { } finally { this.base = oldbase; + this.cc = oldcc; } }