From a9e377d6bb1e8a7d24acafb23981ad801ef85e0e Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Wed, 30 Oct 2024 19:27:33 -0400 Subject: [PATCH] Don't assume T_FLOAT for flonums For debugging. --- include/ruby/internal/globals.h | 4 ---- include/ruby/internal/value_type.h | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/include/ruby/internal/globals.h b/include/ruby/internal/globals.h index 60d8e5309aebd4..8b5a286546c0de 100644 --- a/include/ruby/internal/globals.h +++ b/include/ruby/internal/globals.h @@ -193,11 +193,7 @@ rb_class_of(VALUE obj) return rb_cFloat; } -#if !RUBY_DEBUG - RBIMPL_UNREACHABLE_RETURN(Qfalse); -#else RUBY_ASSERT_FAIL("unexpected type"); -#endif } #define CLASS_OF rb_class_of /**< @old{rb_class_of} */ diff --git a/include/ruby/internal/value_type.h b/include/ruby/internal/value_type.h index aedd0abe4b4456..970c7970f29b7b 100644 --- a/include/ruby/internal/value_type.h +++ b/include/ruby/internal/value_type.h @@ -246,7 +246,7 @@ rb_type(VALUE obj) return RUBY_T_SYMBOL; } else { - RBIMPL_ASSUME(RB_FLONUM_P(obj)); + RUBY_ASSERT_ALWAYS(RB_FLONUM_P(obj)); return RUBY_T_FLOAT; } }