mirror of
https://github.com/janet-lang/janet
synced 2025-12-12 19:48:07 +00:00
Fix NaNboxing bug that cause flaky builds.
The macro janet_checktype(x, JANET_NUMBER) was incorrect when x was NaN. This caused the initial unmarshalling dictionary to be missing entries in certain cases.
This commit is contained in:
@@ -579,7 +579,7 @@ JANET_API Janet janet_wrap_integer(int32_t x);
|
||||
(((x).u64 & JANET_NANBOX_TAGBITS) == janet_nanbox_tag((type)))
|
||||
|
||||
#define janet_nanbox_isnumber(x) \
|
||||
(!isnan((x).number) || janet_nanbox_checkauxtype((x), JANET_NUMBER))
|
||||
(!isnan((x).number) || ((((x).u64 >> 47) & 0xF) == JANET_NUMBER))
|
||||
|
||||
#define janet_checktype(x, t) \
|
||||
(((t) == JANET_NUMBER) \
|
||||
|
||||
Reference in New Issue
Block a user