diff options
author | Mike Pall <mike> | 2022-07-28 15:38:54 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2022-07-28 15:38:54 +0200 |
commit | 9c3df68a1e00bd1fcaee13610fb063efe8ae3825 (patch) | |
tree | 5a6a38503edb1a50bb7eda65a125d77614932660 /src | |
parent | e1339aed3db2fb8488a170383fc456fe04879709 (diff) | |
download | luajit-9c3df68a1e00bd1fcaee13610fb063efe8ae3825.tar.gz luajit-9c3df68a1e00bd1fcaee13610fb063efe8ae3825.tar.bz2 luajit-9c3df68a1e00bd1fcaee13610fb063efe8ae3825.zip |
Add missing GC steps to string buffer methods.
Reported by Cosmin Apreutesei.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib_buffer.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib_buffer.c b/src/lib_buffer.c index e3d24504..aad8e7eb 100644 --- a/src/lib_buffer.c +++ b/src/lib_buffer.c | |||
@@ -323,6 +323,7 @@ LJLIB_CF(buffer_new) | |||
323 | setgcref(sbx->dict_str, obj2gco(dict_str)); | 323 | setgcref(sbx->dict_str, obj2gco(dict_str)); |
324 | setgcref(sbx->dict_mt, obj2gco(dict_mt)); | 324 | setgcref(sbx->dict_mt, obj2gco(dict_mt)); |
325 | if (sz > 0) lj_buf_need2((SBuf *)sbx, sz); | 325 | if (sz > 0) lj_buf_need2((SBuf *)sbx, sz); |
326 | lj_gc_check(L); | ||
326 | return 1; | 327 | return 1; |
327 | } | 328 | } |
328 | 329 | ||
@@ -339,6 +340,7 @@ LJLIB_CF(buffer_decode) LJLIB_REC(.) | |||
339 | GCstr *str = lj_lib_checkstrx(L, 1); | 340 | GCstr *str = lj_lib_checkstrx(L, 1); |
340 | setnilV(L->top++); | 341 | setnilV(L->top++); |
341 | lj_serialize_decode(L, L->top-1, str); | 342 | lj_serialize_decode(L, L->top-1, str); |
343 | lj_gc_check(L); | ||
342 | return 1; | 344 | return 1; |
343 | } | 345 | } |
344 | 346 | ||