fix bug when 0 + other object

This commit is contained in:
ksss
2014-03-16 22:52:25 +09:00
parent 18bebd3acd
commit e9f3dca0f4
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -1131,10 +1131,10 @@ mrb_fixnum_plus(mrb_state *mrb, mrb_value x, mrb_value y)
mrb_int a;
a = mrb_fixnum(x);
if (a == 0) return y;
if (mrb_fixnum_p(y)) {
mrb_int b, c;
if (a == 0) return y;
b = mrb_fixnum(y);
c = a + b;
if (((a < 0) ^ (b < 0)) == 0 && (a < 0) != (c < 0)) {