summaryrefslogtreecommitdiff
path: root/src/lvm.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lvm.js')
-rw-r--r--src/lvm.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lvm.js b/src/lvm.js
index bd38575..d45ecec 100644
--- a/src/lvm.js
+++ b/src/lvm.js
@@ -166,7 +166,12 @@ const luaV_execute = function(L) {
break;
}
case OCi.OP_SETUPVAL: {
- cl.upvals[i.B].setval(L, ra);
+ let uv = cl.upvals[i.B];
+ if (uv.v !== null) {
+ uv.L.stack[uv.v] = L.stack[ra];
+ } else {
+ uv.value.setfrom(L.stack[ra]);
+ }
break;
}
case OCi.OP_GETTABUP: {