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 4166e7a commit 74b52e6
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 @@ -165,9 +165,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 74b52e6

Please sign in to comment.