lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


A few weeks ago someone reported a bug in the EGC patch and I forgot to 
announce the new version of the EGC patch that fixes the bug.

Here is the new patch:
http://lua-users.org/files/wiki_insecure/power_patches/5.1/emergency_gc-5.1.4-r2.patch

Here is more info about the EGC patch:
http://lua-users.org/wiki/EmergencyGarbageCollector

Attached is a smaller patch with the bugfix, for anyone that is already using 
the original EGC patch.

-- 
Robert G. Jakabosky
diff --git a/src/lvm.c b/src/lvm.c
index 23c39ef..b742622 100644
--- a/src/lvm.c
+++ b/src/lvm.c
@@ -459,7 +459,9 @@ void luaV_execute (lua_State *L, int nexeccalls) {
       case OP_NEWTABLE: {
         int b = GETARG_B(i);
         int c = GETARG_C(i);
-        sethvalue(L, ra, luaH_new(L, luaO_fb2int(b), luaO_fb2int(c)));
+        Table *h;
+        Protect(h = luaH_new(L, luaO_fb2int(b), luaO_fb2int(c)));
+        sethvalue(L, RA(i), h);
         Protect(luaC_checkGC(L));
         continue;
       }