Commit 1f35f2dd authored by antirez's avatar antirez
Browse files

Lua debugger: fix trace command infinite loop.

Thanks to Itamar Haber for bug report and test case to reproduce.
parent 6604e042
...@@ -2172,11 +2172,12 @@ void ldbTrace(lua_State *lua) { ...@@ -2172,11 +2172,12 @@ void ldbTrace(lua_State *lua) {
while(lua_getstack(lua,level,&ar)) { while(lua_getstack(lua,level,&ar)) {
lua_getinfo(lua,"Snl",&ar); lua_getinfo(lua,"Snl",&ar);
if(strstr(ar.short_src,"user_script") == NULL) continue; if(strstr(ar.short_src,"user_script") != NULL) {
ldbLog(sdscatprintf(sdsempty(),"%s %s:", ldbLog(sdscatprintf(sdsempty(),"%s %s:",
(level == 0) ? "In" : "From", (level == 0) ? "In" : "From",
ar.name ? ar.name : "top level")); ar.name ? ar.name : "top level"));
ldbLogSourceLine(ar.currentline); ldbLogSourceLine(ar.currentline);
}
level++; level++;
} }
if (level == 0) { if (level == 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment