From 86679f8530d0e0dec9e01027e186fd164bd0d1c3 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 29 May 2017 13:42:12 +1000 Subject: src/lvm.js: OP_GETTABLE should use RB not RKB Almost move into order similar to lua's lvm.c --- src/lvm.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/lvm.js b/src/lvm.js index b7b1358..ce978f4 100644 --- a/src/lvm.js +++ b/src/lvm.js @@ -186,6 +186,12 @@ const luaV_execute = function(L) { gettable(L, upval, rc, ra); break; } + case OCi.OP_GETTABLE: { + let rb = L.stack[RB(L, base, i)]; + let rc = RKC(L, base, k, i); + gettable(L, rb, rc, ra); + break; + } case OCi.OP_SETTABUP: { let upval = cl.upvals[i.A].v; let rb = RKB(L, base, k, i); @@ -193,12 +199,6 @@ const luaV_execute = function(L) { settable(L, upval, rb, rc); break; } - case OCi.OP_GETTABLE: { - let table = RKB(L, base, k, i); - let key = RKC(L, base, k, i); - - gettable(L, table, key, ra); - break; } case OCi.OP_SETTABLE: { let table = L.stack[ra]; -- cgit v1.2.3-70-g09d2