aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author罗泽轩 <spacewanderlzx@gmail.com>2018-12-07 17:17:38 +0800
committerThibault Charbonnier <thibaultcha@users.noreply.github.com>2018-12-07 01:17:38 -0800
commit9931667547e2eda9911ec07b0f408b1a04b8a46c (patch)
tree5f85da72a7497d317788931f79c23df6b11676b3
parentf88d2b47027508bcf6f2d45bd0d07f79cd29c651 (diff)
downloadlua-cjson-9931667547e2eda9911ec07b0f408b1a04b8a46c.tar.gz
lua-cjson-9931667547e2eda9911ec07b0f408b1a04b8a46c.tar.bz2
lua-cjson-9931667547e2eda9911ec07b0f408b1a04b8a46c.zip
bugfix: we now only apply the lightuserdata mask on platforms that are at least 64bits.2.1.0.7rc22.1.0.7
-rw-r--r--lua_cjson.c5
1 files changed, 5 insertions, 0 deletions
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 @@
93#define strcasecmp _stricmp 93#define strcasecmp _stricmp
94#endif 94#endif
95 95
96#if LONG_MAX > ((1UL << 31) - 1)
96#define json_lightudata_mask(ludata) \ 97#define json_lightudata_mask(ludata) \
97 ((void *) ((uintptr_t) (ludata) & ((1UL << 47) - 1))) 98 ((void *) ((uintptr_t) (ludata) & ((1UL << 47) - 1)))
98 99
100#else
101#define json_lightudata_mask(ludata) (ludata)
102#endif
103
99static const char * const *json_empty_array; 104static const char * const *json_empty_array;
100static const char * const *json_array; 105static const char * const *json_array;
101 106