diff options
| author | 罗泽轩 <spacewanderlzx@gmail.com> | 2018-12-07 17:17:38 +0800 |
|---|---|---|
| committer | Thibault Charbonnier <thibaultcha@users.noreply.github.com> | 2018-12-07 01:17:38 -0800 |
| commit | 9931667547e2eda9911ec07b0f408b1a04b8a46c (patch) | |
| tree | 5f85da72a7497d317788931f79c23df6b11676b3 | |
| parent | f88d2b47027508bcf6f2d45bd0d07f79cd29c651 (diff) | |
| download | lua-cjson-2.1.0.7.tar.gz lua-cjson-2.1.0.7.tar.bz2 lua-cjson-2.1.0.7.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.c | 5 |
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 | |||
| 99 | static const char * const *json_empty_array; | 104 | static const char * const *json_empty_array; |
| 100 | static const char * const *json_array; | 105 | static const char * const *json_array; |
| 101 | 106 | ||
