From 2708fb6ba7636adf1d8263dd2654f257f8b76324 Mon Sep 17 00:00:00 2001
From: naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
Date: Mon, 15 Feb 2016 19:42:59 +0000
Subject: * insns.def (opt_plus): simply use LONG2NUM() instead of wrongly     
  complex overflow case.

* insns.def (opt_sub): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
---
 insns.def | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

(limited to 'insns.def')

diff --git a/insns.def b/insns.def
index 506bbe21a7..f9514d4038 100644
--- a/insns.def
+++ b/insns.def
@@ -1332,12 +1332,7 @@ opt_plus
 	a = FIX2LONG(recv);
 	b = FIX2LONG(obj);
 	c = a + b;
-	if (FIXABLE(c)) {
-	    val = LONG2FIX(c);
-	}
-	else {
-	    val = rb_big_plus(rb_int2big(a), rb_int2big(b));
-	}
+	val = LONG2NUM(c);
 #endif
     }
     else if (FLONUM_2_P(recv, obj) &&
@@ -1387,13 +1382,7 @@ opt_minus
 	a = FIX2LONG(recv);
 	b = FIX2LONG(obj);
 	c = a - b;
-
-	if (FIXABLE(c)) {
-	    val = LONG2FIX(c);
-	}
-	else {
-	    val = rb_big_minus(rb_int2big(a), rb_int2big(b));
-	}
+	val = LONG2NUM(c);
     }
     else if (FLONUM_2_P(recv, obj) &&
 	     BASIC_OP_UNREDEFINED_P(BOP_MINUS, FLOAT_REDEFINED_OP_FLAG)) {
-- 
cgit v1.2.3

