mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
symbol.c: fix pointer tagging for windows
SYMTBL_LITERAL_FLAG was defined as 1UL, which can be smaller than uintptr_t on some platforms (e.g., Windows 64-bit). This caused symtbl_get_ptr() to return a corrupted pointer. Changed the flag to be explicitly cast to uintptr_t to ensure correct behavior on all platforms. Co-authored-by: Gemini <gemini@google.com>
This commit is contained in:
+1
-1
@@ -54,7 +54,7 @@ presym_sym2name(mrb_sym sym, mrb_int *lenp)
|
||||
/* ------------------------------------------------------ */
|
||||
|
||||
/* LSB pointer tagging for literal flags */
|
||||
#define SYMTBL_LITERAL_FLAG 1UL
|
||||
#define SYMTBL_LITERAL_FLAG ((uintptr_t)1)
|
||||
|
||||
/* Extract clean pointer for memory operations */
|
||||
static inline const char*
|
||||
|
||||
Reference in New Issue
Block a user