Skip to content

Commit b4ade78

Browse files
spacewanderthibaultcha
authored andcommitted
bugfix: we now only apply the lightuserdata mask on platforms that are at least 64bits.
Thanks Alec Muffett for the report.
1 parent 1c72f57 commit b4ade78

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ngx_http_lua_common.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,14 @@ typedef struct {
140140
#endif
141141

142142

143+
#if (NGX_PTR_SIZE >= 8)
143144
#define ngx_http_lua_lightudata_mask(ludata) \
144145
((void *) ((uintptr_t) (&ngx_http_lua_##ludata) & ((1UL << 47) - 1)))
145146

147+
#else
148+
#define ngx_http_lua_lightudata_mask(ludata) (&ngx_http_lua_##ludata)
149+
#endif
150+
146151

147152
typedef struct ngx_http_lua_main_conf_s ngx_http_lua_main_conf_t;
148153
typedef union ngx_http_lua_srv_conf_u ngx_http_lua_srv_conf_t;

0 commit comments

Comments
 (0)