aboutsummaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-11-22 16:41:20 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-11-22 16:41:20 -0200
commit41f2936d8f2ec3894e0ef013f6b9e8f6ea17c181 (patch)
tree7796c2687563ed326aa977774406ca6569200a4f /lvm.c
parent14c3aa12b5a609f45b9be49e11ee862f9193a014 (diff)
downloadlua-41f2936d8f2ec3894e0ef013f6b9e8f6ea17c181.tar.gz
lua-41f2936d8f2ec3894e0ef013f6b9e8f6ea17c181.tar.bz2
lua-41f2936d8f2ec3894e0ef013f6b9e8f6ea17c181.zip
new opcode 'OP_EQI' for equality with immediate numbers
Diffstat (limited to 'lvm.c')
-rw-r--r--lvm.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/lvm.c b/lvm.c
index b673db91..6c4bab08 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 2.312 2017/11/20 12:57:39 roberto Exp roberto $ 2** $Id: lvm.c,v 2.313 2017/11/21 14:17:35 roberto Exp $
3** Lua virtual machine 3** Lua virtual machine
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -1392,6 +1392,17 @@ void luaV_execute (lua_State *L) {
1392 donextjump(ci); 1392 donextjump(ci);
1393 vmbreak; 1393 vmbreak;
1394 } 1394 }
1395 vmcase(OP_EQI) {
1396 TValue *rb = vRB(i);
1397 int ic = GETARG_sC(i);
1398 if ((ttisinteger(rb) ? (ivalue(rb) == ic)
1399 :ttisfloat(rb) ? luai_numeq(fltvalue(rb), cast_num(ic))
1400 : 0) != GETARG_A(i))
1401 pc++;
1402 else
1403 donextjump(ci);
1404 vmbreak;
1405 }
1395 vmcase(OP_TEST) { 1406 vmcase(OP_TEST) {
1396 if (GETARG_C(i) ? l_isfalse(s2v(ra)) : !l_isfalse(s2v(ra))) 1407 if (GETARG_C(i) ? l_isfalse(s2v(ra)) : !l_isfalse(s2v(ra)))
1397 pc++; 1408 pc++;