From 6e03c38e3951afb0206dc7d418324ce91c41a575 Mon Sep 17 00:00:00 2001 From: James Roseborough Date: Fri, 23 May 2008 18:43:56 +0000 Subject: [PATCH] perform function metatable calls outside of current stack frame. --- src/core/org/luaj/vm/LuaState.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/org/luaj/vm/LuaState.java b/src/core/org/luaj/vm/LuaState.java index 956f9f3f..ada47d65 100644 --- a/src/core/org/luaj/vm/LuaState.java +++ b/src/core/org/luaj/vm/LuaState.java @@ -930,10 +930,11 @@ public class LuaState extends Lua { } } if (h.isFunction()) { - LFunction f = (LFunction) h; int oldtop = top; int oldbase = base; try { + base = base + this.calls[cc].closure.p.maxstacksize; + top = base; pushlvalue(h); pushlvalue(table); pushlvalue(key); @@ -972,10 +973,11 @@ public class LuaState extends Lua { } } if (h.isFunction()) { - LFunction f = (LFunction) h; int oldtop = top; int oldbase = base; try { + base = base + this.calls[cc].closure.p.maxstacksize; + top = base; pushlvalue(h); pushlvalue(table); pushlvalue(key);