Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
1f35f2dd
Commit
1f35f2dd
authored
Nov 17, 2015
by
antirez
Browse files
Lua debugger: fix trace command infinite loop.
Thanks to Itamar Haber for bug report and test case to reproduce.
parent
6604e042
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/scripting.c
View file @
1f35f2dd
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment