mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 15:14:08 +00:00
FFI: Ensure library is loaded before de-serializing FFI types.
Reported by ImagicTheCat.
This commit is contained in:
parent
d5a237eae0
commit
c21c6cb417
@ -448,6 +448,10 @@ encoded data. The stand-alone function throws when there's left-over
|
|||||||
data after decoding a single top-level object. The buffer method leaves
|
data after decoding a single top-level object. The buffer method leaves
|
||||||
any left-over data in the buffer.
|
any left-over data in the buffer.
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
Attempting to de-serialize an FFI type will throw an error, if the FFI
|
||||||
|
library is not built-in or has not been loaded, yet.
|
||||||
|
</p>
|
||||||
|
|
||||||
<h3 id="serialize_options">Serialization Options</h3>
|
<h3 id="serialize_options">Serialization Options</h3>
|
||||||
<p>
|
<p>
|
||||||
|
@ -417,6 +417,7 @@ static char *serialize_get(char *r, SBufExt *sbx, TValue *o)
|
|||||||
uint32_t sz = tp == SER_TAG_COMPLEX ? 16 : 8;
|
uint32_t sz = tp == SER_TAG_COMPLEX ? 16 : 8;
|
||||||
GCcdata *cd;
|
GCcdata *cd;
|
||||||
if (LJ_UNLIKELY(r + sz > w)) goto eob;
|
if (LJ_UNLIKELY(r + sz > w)) goto eob;
|
||||||
|
if (LJ_UNLIKELY(!ctype_ctsG(G(sbufL(sbx))))) goto badtag;
|
||||||
cd = lj_cdata_new_(sbufL(sbx),
|
cd = lj_cdata_new_(sbufL(sbx),
|
||||||
tp == SER_TAG_INT64 ? CTID_INT64 :
|
tp == SER_TAG_INT64 ? CTID_INT64 :
|
||||||
tp == SER_TAG_UINT64 ? CTID_UINT64 : CTID_COMPLEX_DOUBLE,
|
tp == SER_TAG_UINT64 ? CTID_UINT64 : CTID_COMPLEX_DOUBLE,
|
||||||
|
Loading…
Reference in New Issue
Block a user