Skip to content

Commit

Permalink
Follow up fix in Lua lvm.c
Browse files Browse the repository at this point in the history
The "Return hook" fix introduced a 64-bit compiler warning about
integer truncation.

It looks safe to cast away the warning.  And that's reinforced
by the fact that other places in the file use `cast_int()` for
the exact same expression.
  • Loading branch information
chrisant996 committed Feb 1, 2024
1 parent eeea08d commit af47db5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/src/lvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ void luaV_execute (lua_State *L) {
vmcasenb(OP_RETURN,
int b = GETARG_B(i);
if (cl->p->sizep > 0) luaF_close(L, base);
b = luaD_poscall(L, ra, (b != 0 ? b - 1 : L->top - ra));
b = luaD_poscall(L, ra, (b != 0 ? b - 1 : cast_int(L->top - ra)));
if (!(ci->callstatus & CIST_REENTRY)) /* 'ci' still the called one */
return; /* external invocation: return */
else { /* invocation via reentry: continue execution */
Expand Down

0 comments on commit af47db5

Please sign in to comment.