From 9bab179ca3ac9cc13c8940e3d1fa67c881507d68 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 11 Apr 2024 14:35:19 -0400 Subject: [PATCH] Don't treat flonum specially in object ID flonum is just a special constant, so we don't need to treat it in any special way. --- gc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gc.c b/gc.c index f67a5d8326..9be07febc8 100644 --- a/gc.c +++ b/gc.c @@ -4522,16 +4522,13 @@ os_id2ref(VALUE os, VALUE objid) static VALUE rb_find_object_id(VALUE obj, VALUE (*get_heap_object_id)(VALUE)) { - if (FLONUM_P(obj)) { + if (SPECIAL_CONST_P(obj)) { #if SIZEOF_LONG == SIZEOF_VOIDP return LONG2NUM((SIGNED_VALUE)obj); #else return LL2NUM((SIGNED_VALUE)obj); #endif } - else if (SPECIAL_CONST_P(obj)) { - return LONG2NUM((SIGNED_VALUE)obj); - } return get_heap_object_id(obj); }