aboutsummaryrefslogtreecommitdiffstats
path: root/enum.c
diff options
context:
space:
mode:
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/enum.c b/enum.c
index ba444e33c6..951e30ab32 100644
--- a/enum.c
+++ b/enum.c
@@ -719,7 +719,8 @@ enum_inject(int argc, VALUE *argv, VALUE obj)
i = 0;
}
id = SYM2ID(op);
- if (id == idPLUS && FIXNUM_P(v)) {
+ if (id == idPLUS && FIXNUM_P(v) &&
+ rb_method_basic_definition_p(rb_cFixnum, idPLUS)) {
long n = FIX2LONG(v);
while (i < RARRAY_LEN(obj)) {
VALUE e = RARRAY_AREF(obj, i);