]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Add missing GC steps to string buffer methods.
authorMike Pall <mike>
Thu, 28 Jul 2022 13:38:54 +0000 (15:38 +0200)
committerMike Pall <mike>
Thu, 28 Jul 2022 13:38:54 +0000 (15:38 +0200)
Reported by Cosmin Apreutesei.

src/lib_buffer.c

index e3d24504b9830b72ae1c7bc0a19b5925256adfa2..aad8e7ebf6c8db17416aeeb56242817b49518e7f 100644 (file)
@@ -323,6 +323,7 @@ LJLIB_CF(buffer_new)
   setgcref(sbx->dict_str, obj2gco(dict_str));
   setgcref(sbx->dict_mt, obj2gco(dict_mt));
   if (sz > 0) lj_buf_need2((SBuf *)sbx, sz);
+  lj_gc_check(L);
   return 1;
 }
 
@@ -339,6 +340,7 @@ LJLIB_CF(buffer_decode)                     LJLIB_REC(.)
   GCstr *str = lj_lib_checkstrx(L, 1);
   setnilV(L->top++);
   lj_serialize_decode(L, L->top-1, str);
+  lj_gc_check(L);
   return 1;
 }