diff options
-rw-r--r-- | src/lanes.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lanes.cpp b/src/lanes.cpp index b54f221..d1a353b 100644 --- a/src/lanes.cpp +++ b/src/lanes.cpp | |||
@@ -363,7 +363,9 @@ LUAG_FUNC(lane_new) | |||
363 | if (_debugName == "auto") { | 363 | if (_debugName == "auto") { |
364 | if (luaG_type(L, kFuncIdx) == LuaType::STRING) { | 364 | if (luaG_type(L, kFuncIdx) == LuaType::STRING) { |
365 | lua_Debug _ar; | 365 | lua_Debug _ar; |
366 | lua_getstack(L, 2, &_ar); // 0 is here, 1 is lanes.gen, 2 is its caller | 366 | if (lua_getstack(L, 2, &_ar) == 0) { // 0 is here, 1 is lanes.gen, 2 is its caller |
367 | lua_getstack(L, 1, &_ar); // level 2 may not exist with LuaJIT, try again with level 1 | ||
368 | } | ||
367 | lua_getinfo(L, "Sl", &_ar); | 369 | lua_getinfo(L, "Sl", &_ar); |
368 | luaG_pushstring(L, "%s:%d", _ar.short_src, _ar.currentline); // L: ... lane "<name>" | 370 | luaG_pushstring(L, "%s:%d", _ar.short_src, _ar.currentline); // L: ... lane "<name>" |
369 | } else { | 371 | } else { |