summaryrefslogtreecommitdiff
path: root/apps/plugins/lua/lvm.c
diff options
context:
space:
mode:
authorWilliam Wilgus <me.theuser@yahoo.com>2018-11-08 11:32:45 -0500
committerWilliam Wilgus <me.theuser@yahoo.com>2018-11-11 19:42:30 -0500
commitb69faf0bcc5ddca1d88b1a7ab47bcbbc6dbb9af1 (patch)
tree191277cab3ef773238c1e91dafaaea04ddca1949 /apps/plugins/lua/lvm.c
parentde6618a2713ef26f888762cbe6539cc65a393c7c (diff)
downloadrockbox-b69faf0bcc5ddca1d88b1a7ab47bcbbc6dbb9af1.zip
rockbox-b69faf0bcc5ddca1d88b1a7ab47bcbbc6dbb9af1.tar.gz
rockbox-b69faf0bcc5ddca1d88b1a7ab47bcbbc6dbb9af1.tar.bz2
rockbox-b69faf0bcc5ddca1d88b1a7ab47bcbbc6dbb9af1.tar.xz
lua update to 5.1.5
Modify Rocklua towards upstream 5.1.5 Clean up some of the Rocklua implementation Change-Id: Iac722e827899cf84f5ca004ef7ae7ddce5f7fbbe
Diffstat (limited to 'apps/plugins/lua/lvm.c')
-rw-r--r--apps/plugins/lua/lvm.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/apps/plugins/lua/lvm.c b/apps/plugins/lua/lvm.c
index acce53a..35a931d 100644
--- a/apps/plugins/lua/lvm.c
+++ b/apps/plugins/lua/lvm.c
@@ -1,5 +1,5 @@
/*
-** $Id: lvm.c,v 2.63.1.3 2007/12/28 15:32:23 roberto Exp $
+** $Id: lvm.c,v 2.63.1.5 2011/08/17 20:43:11 roberto Exp $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ -133,6 +133,7 @@ void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) {
void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
int loop;
+ TValue temp;
for (loop = 0; loop < MAXTAGLOOP; loop++) {
const TValue *tm;
if (ttistable(t)) { /* `t' is a table? */
@@ -141,6 +142,7 @@ void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
if (!ttisnil(oldval) || /* result is no nil? */
(tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL) { /* or no TM? */
setobj2t(L, oldval, val);
+ h->flags = 0;
luaC_barriert(L, h, val);
return;
}
@@ -152,7 +154,9 @@ void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
callTM(L, tm, t, key, val);
return;
}
- t = tm; /* else repeat with `tm' */
+ /* else repeat with `tm' */
+ setobj(L, &temp, tm); /* avoid pointing inside table (may rehash) */
+ t = &temp;
}
luaG_runerror(L, "loop in settable");
}
@@ -480,6 +484,7 @@ void luaV_execute (lua_State *L, int nexeccalls) {
continue;
}
case OP_DIV: {
+ /* ROCKLUA INTEGER BUGFIX */
TValue *rb = RKB(i);
TValue *rc = RKC(i);
if (ttisnumber(rb) && ttisnumber(rc)) {
@@ -495,6 +500,7 @@ void luaV_execute (lua_State *L, int nexeccalls) {
continue;
}
case OP_MOD: {
+ /* ROCKLUA INTEGER BUGFIX */
TValue *rb = RKB(i);
TValue *rc = RKC(i);
if (ttisnumber(rb) && ttisnumber(rc)) {
@@ -508,7 +514,7 @@ void luaV_execute (lua_State *L, int nexeccalls) {
Protect(Arith(L, ra, rb, rc, TM_MOD));
continue;
- }
+ }
case OP_POW: {
arith_op(luai_numpow, TM_POW);
continue;