Skip to content

Commit 60225ad

Browse files
spacewanderthibaultcha
authored andcommitted
bugfix: the lightuserdata mask was broken in WIN64.
In WIN64, the pointer type is 64 bits but the long type is 32 bits. Since WIN64 only supports x64 and IA64, we could confirm that it doesn't need the mask. If we need the mask in the future, we might need to use a C compiler which supports C99 (like MSVC 2013+ or any other modern C compiler) to build the WIN64 version.
1 parent b4ade78 commit 60225ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ngx_http_lua_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ typedef struct {
140140
#endif
141141

142142

143-
#if (NGX_PTR_SIZE >= 8)
143+
#if (NGX_PTR_SIZE >= 8 && !defined(_WIN64))
144144
#define ngx_http_lua_lightudata_mask(ludata) \
145145
((void *) ((uintptr_t) (&ngx_http_lua_##ludata) & ((1UL << 47) - 1)))
146146

0 commit comments

Comments
 (0)