From 703a24a9478e83925e4275d126bb54848a72076b Mon Sep 17 00:00:00 2001
From: usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
Date: Wed, 16 Dec 2015 07:11:41 +0000
Subject: merge revision(s) 53039: [Backport #11804]

	* insns.def (opt_case_dispatch): avoid converting Infinity

	* test/ruby/test_optimization.rb (test_opt_case_dispatch_inf): new
	  [ruby-dev:49423] [Bug #11804]'


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@53147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
---
 insns.def | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'insns.def')

diff --git a/insns.def b/insns.def
index def758a317..1521cb05e9 100644
--- a/insns.def
+++ b/insns.def
@@ -1275,7 +1275,7 @@ opt_case_dispatch
     switch(TYPE(key)) {
       case T_FLOAT: {
 	double ival;
-	if (modf(RFLOAT_VALUE(key), &ival) == 0.0) {
+	if (modf(RFLOAT_VALUE(key), &ival) == 0.0 && !isinf(ival)) {
 	    key = FIXABLE(ival) ? LONG2FIX((long)ival) : rb_dbl2big(ival);
 	}
       }
-- 
cgit v1.2.3

