langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java
changeset 27122 c14f94b48e30
parent 27120 8ed4ea81b048
child 27123 10171e97e021
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java	Mon Oct 13 17:22:47 2014 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java	Mon Oct 13 12:12:06 2014 -0400
@@ -1225,8 +1225,8 @@
             // consider the size of the bytecode.
             // A discussion of the metric can be found here:
             // http://mail.openjdk.java.net/pipermail/compiler-dev/2014-September/008987.html
-            int table_cost = 4 + (hi - lo + 1); // words
-            int lookup_cost = 3 + 2 * nlabels;
+            long table_cost = 4 + ((long)hi - lo + 1); // words
+            long lookup_cost = 3 + 2 * (long)nlabels;
             int opcode = table_cost <= lookup_cost ? tableswitch : lookupswitch;
 
             int startpc = code.curCP();    // the position of the selector operation