Skip to content

Commit

Permalink
Don't assume T_FLOAT for flonums
Browse files Browse the repository at this point in the history
For debugging.
  • Loading branch information
XrXr committed Oct 31, 2024
1 parent 32c733f commit a9e377d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions include/ruby/internal/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -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} */
Expand Down
2 changes: 1 addition & 1 deletion include/ruby/internal/value_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit a9e377d

Please sign in to comment.