mirror of
https://github.com/fluencelabs/redis
synced 2025-03-30 22:31:03 +00:00
Lua debugger: fix trace command infinite loop.
Thanks to Itamar Haber for bug report and test case to reproduce.
This commit is contained in:
parent
6604e04260
commit
1f35f2dd5a
@ -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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user