Skip to content

Commit 260b376

Browse files
[GR-45346] Backport 22.3 :handle different stamps in ZeroExtendNode#alwaysPositive.
PullRequest: graal/14261
2 parents c2a3325 + 9548b47 commit 260b376

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/src/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ZeroExtendNode.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,12 @@ public static ValueNode create(ValueNode input, int inputBits, int resultBits, N
8787
}
8888

8989
private static boolean inputAlwaysPositive(ValueNode v) {
90-
return ((IntegerStamp) v.stamp(NodeView.DEFAULT)).isPositive();
90+
Stamp s = v.stamp(NodeView.DEFAULT);
91+
if (s instanceof IntegerStamp) {
92+
return ((IntegerStamp) s).isPositive();
93+
} else {
94+
return false;
95+
}
9196
}
9297

9398
@Override

0 commit comments

Comments
 (0)