From 9931667547e2eda9911ec07b0f408b1a04b8a46c Mon Sep 17 00:00:00 2001 From: 罗泽轩 Date: Fri, 7 Dec 2018 17:17:38 +0800 Subject: bugfix: we now only apply the lightuserdata mask on platforms that are at least 64bits. --- lua_cjson.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua_cjson.c b/lua_cjson.c index 9de3f5a..2a69699 100644 --- a/lua_cjson.c +++ b/lua_cjson.c @@ -93,9 +93,14 @@ #define strcasecmp _stricmp #endif +#if LONG_MAX > ((1UL << 31) - 1) #define json_lightudata_mask(ludata) \ ((void *) ((uintptr_t) (ludata) & ((1UL << 47) - 1))) +#else +#define json_lightudata_mask(ludata) (ludata) +#endif + static const char * const *json_empty_array; static const char * const *json_array; -- cgit v1.2.3-55-g6feb