Skip to content

Commit

Permalink
lj_bcread.c: Remove suspicious loop
Browse files Browse the repository at this point in the history
Remove a loop in bcread_varinfo() that looks strange.

What is this loop supposed to do? The code doesn't make sense to me,
and this change is resolving a segfault problem.
  • Loading branch information
lukego committed May 8, 2018
1 parent 8d9d959 commit 01f8b4c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/lj_bcread.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,7 @@ static void bcread_dbg(LexState *ls, GCproto *pt, MSize sizedbg)
static const void *bcread_varinfo(GCproto *pt)
{
const uint8_t *p = proto_uvinfo(pt);
MSize n = pt->sizeuv;
if (n) while (*p++ || --n) ;
return p;
return p + pt->sizeuv;
}

/* Read a single constant key/value of a template table. */
Expand Down

0 comments on commit 01f8b4c

Please sign in to comment.