From c5d8c7210d7f90c85cf3703742740ccca56fb6f1 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 21 Aug 2025 10:04:18 +0900 Subject: [PATCH] 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 --- src/symbol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/symbol.c b/src/symbol.c index 539de536d..9f277a57d 100644 --- a/src/symbol.c +++ b/src/symbol.c @@ -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*