Skip to content

Commit

Permalink
bugfix: we now only apply the lightuserdata mask on platforms that ar…
Browse files Browse the repository at this point in the history
…e at least 64bits.
  • Loading branch information
spacewander authored and thibaultcha committed Dec 7, 2018
1 parent f88d2b4 commit 9931667
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua_cjson.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 9931667

Please sign in to comment.