1
0
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:
Calvin Rose
2020-09-06 14:58:30 -05:00
parent 321a758ab9
commit 24b8b0e382
6 changed files with 73 additions and 67 deletions

View File

@@ -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) \