summaryrefslogtreecommitdiff
path: root/src/BLua.cc
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2013-07-25 08:49:46 +0200
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2013-07-25 08:49:46 +0200
commitb92f0cee87ae48608c279d7192872b83a29b8fc5 (patch)
tree67bac6f26923b57099961ee6827934272fa14dfc /src/BLua.cc
parente893ac885837d1d5ae6c15b33657fdebf6a53eb8 (diff)
*cough* small issue in the Lua code (plus LuaJIT sometime can be buggersome).
Diffstat (limited to 'src/BLua.cc')
-rw-r--r--src/BLua.cc23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/BLua.cc b/src/BLua.cc
index 6005035..1ce20e6 100644
--- a/src/BLua.cc
+++ b/src/BLua.cc
@@ -216,9 +216,10 @@ int Balau::LuaStatics::callwrap(lua_State * __L, lua_CFunction func) {
catch (Balau::GeneralException e) {
L.error(String("GeneralException: ") + e.getMsg());
}
- catch (...) {
- L.error("Unknown C++ exception");
- }
+// LuaJIT sucks sometime.
+// catch (...) {
+// L.error("Unknown C++ exception");
+// }
return 0;
}
@@ -311,7 +312,7 @@ void Balau::Lua::open_base() {
push("print");
push(LuaStatics::print);
settable();
- while (n < gettop()) remove(n);
+ while (n < gettop()) remove(-1);
push("mkdir");
push(LuaStatics::mkdir);
settable(LUA_GLOBALSINDEX);
@@ -335,7 +336,7 @@ void Balau::Lua::open_base() {
void Balau::Lua::open_table() {
int n = gettop();
luaopen_table(L);
- while (n < gettop()) remove(n);
+ while (n < gettop()) remove(-1);
}
void Balau::Lua::open_string() {
@@ -344,37 +345,37 @@ void Balau::Lua::open_string() {
push("iconv");
push(LuaStatics::iconv);
settable();
- while (n < gettop()) remove(n);
+ while (n < gettop()) remove(-1);
}
void Balau::Lua::open_math() {
int n = gettop();
luaopen_math(L);
- while (n < gettop()) remove(n);
+ while (n < gettop()) remove(-1);
}
void Balau::Lua::open_debug() {
int n = gettop();
luaopen_debug(L);
- while (n < gettop()) remove(n);
+ while (n < gettop()) remove(-1);
}
void Balau::Lua::open_jit() {
int n = gettop();
luaopen_jit(L);
- while (n < gettop()) remove(n);
+ while (n < gettop()) remove(-1);
}
void Balau::Lua::open_ffi() {
int n = gettop();
luaopen_ffi(L);
- while (n < gettop()) remove(n);
+ while (n < gettop()) remove(-1);
}
void Balau::Lua::open_bit() {
int n = gettop();
luaopen_bit(L);
- while (n < gettop()) remove(n);
+ while (n < gettop()) remove(-1);
}
void Balau::Lua::declareFunc(const char * name, lua_CFunction f, int i) {