aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-11-25 10:11:05 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-11-25 10:11:05 -0300
commit48835c76c8df62fab4827a9835b351718d20df4b (patch)
tree499d4adb856f159107f668d22ba0c196718de4e8
parent6b3e116d44eed387aa93126c48eae8a64b38bfc2 (diff)
downloadlua-48835c76c8df62fab4827a9835b351718d20df4b.tar.gz
lua-48835c76c8df62fab4827a9835b351718d20df4b.tar.bz2
lua-48835c76c8df62fab4827a9835b351718d20df4b.zip
Wrong assert in 'collectvalidlines'
-rw-r--r--ldebug.c2
-rw-r--r--testes/db.lua2
2 files changed, 2 insertions, 2 deletions
diff --git a/ldebug.c b/ldebug.c
index 30a28828..dc5f78c6 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -304,7 +304,7 @@ static void collectvalidlines (lua_State *L, Closure *f) {
304 if (!p->is_vararg) /* regular function? */ 304 if (!p->is_vararg) /* regular function? */
305 i = 0; /* consider all instructions */ 305 i = 0; /* consider all instructions */
306 else { /* vararg function */ 306 else { /* vararg function */
307 lua_assert(p->code[0] == OP_VARARGPREP); 307 lua_assert(GET_OPCODE(p->code[0]) == OP_VARARGPREP);
308 currentline = nextline(p, currentline, 0); 308 currentline = nextline(p, currentline, 0);
309 i = 1; /* skip first instruction (OP_VARARGPREP) */ 309 i = 1; /* skip first instruction (OP_VARARGPREP) */
310 } 310 }
diff --git a/testes/db.lua b/testes/db.lua
index 11dfd26c..e0699724 100644
--- a/testes/db.lua
+++ b/testes/db.lua
@@ -225,7 +225,7 @@ do -- testing active lines
225 -- 5th line is empty 225 -- 5th line is empty
226 end, {3, 4, 6}) 226 end, {3, 4, 6})
227 227
228 checkactivelines(function (...) end, {0}) 228 checkactivelines(function (a, b, ...) end, {0})
229 229
230 checkactivelines(function (a, b) 230 checkactivelines(function (a, b)
231 end, {1}) 231 end, {1})