From 1adaeefa6b8abf5edc5ff874eec164e83ffdee7e Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Tue, 30 Jul 2019 13:46:05 -0700 Subject: [PATCH] Check that the given value is a number in RB_FIX2INT when SIZEOF_INT == SIZEOF_LONG Fixes [Bug #15551] --- include/ruby/ruby.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 5456dbc941..a410141bcf 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -711,8 +711,8 @@ unsigned long rb_fix2uint(VALUE); #else /* SIZEOF_INT < SIZEOF_LONG */ #define RB_NUM2INT(x) ((int)RB_NUM2LONG(x)) #define RB_NUM2UINT(x) ((unsigned int)RB_NUM2ULONG(x)) -#define RB_FIX2INT(x) ((int)RB_FIX2LONG(x)) -#define RB_FIX2UINT(x) ((unsigned int)RB_FIX2ULONG(x)) +#define RB_FIX2INT(x) ((int)rb_num2long(x)) +#define RB_FIX2UINT(x) ((unsigned int)rb_num2ulong(x)) #endif /* SIZEOF_INT < SIZEOF_LONG */ #define NUM2INT(x) RB_NUM2INT(x) #define NUM2UINT(x) RB_NUM2UINT(x) -- 2.21.0