Save and restore call counter for calls, since they may fail and leave elements on the stack when an Exception is thrown.
This commit is contained in:
@@ -313,6 +313,7 @@ public class LuaState extends Lua {
|
|||||||
|
|
||||||
// save stack state
|
// save stack state
|
||||||
int oldbase = base;
|
int oldbase = base;
|
||||||
|
int oldcc = cc;
|
||||||
try {
|
try {
|
||||||
|
|
||||||
// rb is base of new call frame
|
// rb is base of new call frame
|
||||||
@@ -341,6 +342,7 @@ public class LuaState extends Lua {
|
|||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
this.base = oldbase;
|
this.base = oldbase;
|
||||||
|
this.cc = oldcc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user