aboutsummaryrefslogtreecommitdiffstats
path: root/numeric.c
diff options
context:
space:
mode:
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/numeric.c b/numeric.c
index 6d4eb86b1a..a767c12bf8 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1518,7 +1518,9 @@ flo_cmp(VALUE x, VALUE y)
MJIT_FUNC_EXPORTED int
rb_float_cmp(VALUE x, VALUE y)
{
- return NUM2INT(flo_cmp(x, y));
+ VALUE c = flo_cmp(x, y);
+ if (NIL_P(c)) rb_cmperr(x, y);
+ return NUM2INT(c);
}
/*