Skip to content

Commit

Permalink
bugfix: ffi.C.FUNC(): it lacked a write barrier which might lead to u…
Browse files Browse the repository at this point in the history
…se-after-free issues and memory corruptions.

Fix #42.
  • Loading branch information
agentzh committed Feb 28, 2019
1 parent 864c72e commit 64b9155
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lj_clib.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ TValue *lj_clib_index(lua_State *L, CLibrary *cl, GCstr *name)
cd = lj_cdata_new(cts, id, CTSIZE_PTR);
*(void **)cdataptr(cd) = p;
setcdataV(L, tv, cd);
lj_gc_anybarriert(L, cl->cache);
}
}
return tv;
Expand Down

0 comments on commit 64b9155

Please sign in to comment.