mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Fix pointer check for non-GC64 mode.
Thanks to Stefan Hett.
This commit is contained in:
parent
17fb96d904
commit
471f8936cb
@ -104,9 +104,10 @@ typedef unsigned int uintptr_t;
|
|||||||
#define checku16(x) ((x) == (int32_t)(uint16_t)(x))
|
#define checku16(x) ((x) == (int32_t)(uint16_t)(x))
|
||||||
#define checki32(x) ((x) == (int32_t)(x))
|
#define checki32(x) ((x) == (int32_t)(x))
|
||||||
#define checku32(x) ((x) == (uint32_t)(x))
|
#define checku32(x) ((x) == (uint32_t)(x))
|
||||||
|
#define checkptr31(x) (((uint64_t)(uintptr_t)(x) >> 31) == 0)
|
||||||
#define checkptr32(x) ((uintptr_t)(x) == (uint32_t)(uintptr_t)(x))
|
#define checkptr32(x) ((uintptr_t)(x) == (uint32_t)(uintptr_t)(x))
|
||||||
#define checkptr47(x) (((uint64_t)(uintptr_t)(x) >> 47) == 0)
|
#define checkptr47(x) (((uint64_t)(uintptr_t)(x) >> 47) == 0)
|
||||||
#define checkptrGC(x) (LJ_GC64 ? checkptr47((x)) : LJ_64 ? checkptr32((x)) :1)
|
#define checkptrGC(x) (LJ_GC64 ? checkptr47((x)) : LJ_64 ? checkptr31((x)) :1)
|
||||||
|
|
||||||
/* Every half-decent C compiler transforms this into a rotate instruction. */
|
/* Every half-decent C compiler transforms this into a rotate instruction. */
|
||||||
#define lj_rol(x, n) (((x)<<(n)) | ((x)>>(-(int)(n)&(8*sizeof(x)-1))))
|
#define lj_rol(x, n) (((x)<<(n)) | ((x)>>(-(int)(n)&(8*sizeof(x)-1))))
|
||||||
|
Loading…
Reference in New Issue
Block a user