Skip to content

Commit

Permalink
Merge pull request #93 from ltratt/promote
Browse files Browse the repository at this point in the history
Promote immediates.
  • Loading branch information
vext01 authored Oct 28, 2024
2 parents 2e2dae3 + cc30e88 commit c1623c4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ void luaV_finishOp (lua_State *L) {
#define op_arithI(L,iop,fop) { \
StkId ra = RA(i); \
TValue *v1 = vRB(i); \
int imm = GETARG_sC(i); \
int imm = yk_promote(GETARG_sC(i)); \
if (ttisinteger(v1)) { \
lua_Integer iv1 = ivalue(v1); \
pc++; setivalue(s2v(ra), iop(L, iv1, imm)); \
Expand Down Expand Up @@ -1031,7 +1031,7 @@ void luaV_finishOp (lua_State *L) {
#define op_orderI(L,opi,opf,inv,tm) { \
StkId ra = RA(i); \
int cond; \
int im = GETARG_sB(i); \
int im = yk_promote(GETARG_sB(i)); \
if (ttisinteger(s2v(ra))) \
cond = opi(ivalue(s2v(ra)), im); \
else if (ttisfloat(s2v(ra))) { \
Expand Down Expand Up @@ -1531,7 +1531,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmcase(OP_MMBINI) {
StkId ra = RA(i);
Instruction pi = *(pc - 2); /* original arith. expression */
int imm = GETARG_sB(i);
int imm = yk_promote(GETARG_sB(i));
TMS tm = (TMS)GETARG_C(i);
int flip = GETARG_k(i);
StkId result = RA(pi);
Expand Down Expand Up @@ -1638,7 +1638,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
vmcase(OP_EQI) {
StkId ra = RA(i);
int cond;
int im = GETARG_sB(i);
int im = yk_promote(GETARG_sB(i));
if (ttisinteger(s2v(ra)))
cond = (ivalue(s2v(ra)) == im);
else if (ttisfloat(s2v(ra)))
Expand Down

0 comments on commit c1623c4

Please sign in to comment.