changeset 17269:83ebc10fb5e9

Return empty ArithmeticOpTable for non-arithmetic stamps.
author Roland Schatz <roland.schatz@oracle.com>
date Tue, 30 Sep 2014 12:00:27 +0200
parents 48c91ed917d8
children 5b7b1cb838e9
files graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ArithmeticOpTable.java
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ArithmeticOpTable.java	Tue Sep 30 14:22:10 2014 +0200
+++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ArithmeticOpTable.java	Tue Sep 30 12:00:27 2014 +0200
@@ -43,9 +43,15 @@
     protected BinaryOp xor;
 
     public static ArithmeticOpTable forStamp(Stamp s) {
-        return ((ArithmeticStamp) s).getOps();
+        if (s instanceof ArithmeticStamp) {
+            return ((ArithmeticStamp) s).getOps();
+        } else {
+            return EMPTY;
+        }
     }
 
+    public static final ArithmeticOpTable EMPTY = new ArithmeticOpTable();
+
     /**
      * Describes the unary negation operation.
      */