فهرست منبع

Fixed bug in 'aux_rawset'

In 'aux_rawset', top must be decremented after the barrier, which
refers to top-1. (Bug introduced in commit c646e57fd.)
Roberto Ierusalimschy 5 سال پیش
والد
کامیت
e3c83835e7
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      lapi.c

+ 1 - 1
lapi.c

@@ -856,9 +856,9 @@ static void aux_rawset (lua_State *L, int idx, TValue *key, int n) {
   t = gettable(L, idx);
   t = gettable(L, idx);
   slot = luaH_set(L, t, key);
   slot = luaH_set(L, t, key);
   setobj2t(L, slot, s2v(L->top - 1));
   setobj2t(L, slot, s2v(L->top - 1));
-  L->top -= n;
   invalidateTMcache(t);
   invalidateTMcache(t);
   luaC_barrierback(L, obj2gco(t), s2v(L->top - 1));
   luaC_barrierback(L, obj2gco(t), s2v(L->top - 1));
+  L->top -= n;
   lua_unlock(L);
   lua_unlock(L);
 }
 }