aboutsummaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
Diffstat (limited to 'lvm.c')
-rw-r--r--lvm.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/lvm.c b/lvm.c
index d802379c..e7781dbf 100644
--- a/lvm.c
+++ b/lvm.c
@@ -980,11 +980,11 @@ void luaV_finishOp (lua_State *L) {
980 980
981 981
982/* 982/*
983** Order operations with register operands. 'opf' actually works 983** Order operations with register operands. 'opn' actually works
984** for all numbers, but the fast track improves performance for 984** for all numbers, but the fast track improves performance for
985** integers. 985** integers.
986*/ 986*/
987#define op_order(L,opi,opf,other) { \ 987#define op_order(L,opi,opn,other) { \
988 int cond; \ 988 int cond; \
989 TValue *rb = vRB(i); \ 989 TValue *rb = vRB(i); \
990 if (ttisinteger(s2v(ra)) && ttisinteger(rb)) { \ 990 if (ttisinteger(s2v(ra)) && ttisinteger(rb)) { \
@@ -993,7 +993,7 @@ void luaV_finishOp (lua_State *L) {
993 cond = opi(ia, ib); \ 993 cond = opi(ia, ib); \
994 } \ 994 } \
995 else if (ttisnumber(s2v(ra)) && ttisnumber(rb)) \ 995 else if (ttisnumber(s2v(ra)) && ttisnumber(rb)) \
996 cond = opf(s2v(ra), rb); \ 996 cond = opn(s2v(ra), rb); \
997 else \ 997 else \
998 Protect(cond = other(L, s2v(ra), rb)); \ 998 Protect(cond = other(L, s2v(ra), rb)); \
999 docondjump(); } 999 docondjump(); }
@@ -1323,8 +1323,9 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
1323 Table *t; 1323 Table *t;
1324 if (b > 0) 1324 if (b > 0)
1325 b = 1 << (b - 1); /* size is 2^(b - 1) */ 1325 b = 1 << (b - 1); /* size is 2^(b - 1) */
1326 if (TESTARG_k(i)) 1326 lua_assert((!TESTARG_k(i)) == (GETARG_Ax(*pc) == 0));
1327 c += GETARG_Ax(*pc) * (MAXARG_C + 1); 1327 if (TESTARG_k(i)) /* non-zero extra argument? */
1328 c += GETARG_Ax(*pc) * (MAXARG_C + 1); /* add it to size */
1328 pc++; /* skip extra argument */ 1329 pc++; /* skip extra argument */
1329 L->top = ra + 1; /* correct top in case of emergency GC */ 1330 L->top = ra + 1; /* correct top in case of emergency GC */
1330 t = luaH_new(L); /* memory allocation */ 1331 t = luaH_new(L); /* memory allocation */
@@ -1558,7 +1559,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
1558 vmcase(OP_EQK) { 1559 vmcase(OP_EQK) {
1559 TValue *rb = KB(i); 1560 TValue *rb = KB(i);
1560 /* basic types do not use '__eq'; we can use raw equality */ 1561 /* basic types do not use '__eq'; we can use raw equality */
1561 int cond = luaV_equalobj(NULL, s2v(ra), rb); 1562 int cond = luaV_rawequalobj(s2v(ra), rb);
1562 docondjump(); 1563 docondjump();
1563 vmbreak; 1564 vmbreak;
1564 } 1565 }