From 8b7c160e73fd4f17ff0393be61c04abebeb71717 Mon Sep 17 00:00:00 2001 From: q66 Date: Mon, 30 Mar 2020 19:19:51 +0200 Subject: [PATCH] Fix wrong check on big endian systems We can't randomly type pun random-sized types on big endian systems. --- src/include/janet.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/janet.h b/src/include/janet.h index 9fb9f416..d874cb53 100644 --- a/src/include/janet.h +++ b/src/include/janet.h @@ -663,7 +663,7 @@ struct Janet { #define janet_type(x) ((x).type) #define janet_checktype(x, t) ((x).type == (t)) #define janet_truthy(x) \ - ((x).type != JANET_NIL && ((x).type != JANET_BOOLEAN || ((x).as.integer & 0x1))) + ((x).type != JANET_NIL && ((x).type != JANET_BOOLEAN || ((x).as.u64 & 0x1))) #define janet_unwrap_struct(x) ((const JanetKV *)(x).as.pointer) #define janet_unwrap_tuple(x) ((const Janet *)(x).as.pointer)