Skip to content

Commit

Permalink
Restrict constant folding on CompareNode.
Browse files Browse the repository at this point in the history
  • Loading branch information
teshull committed Feb 27, 2023
1 parent 81af295 commit fbe628e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public final boolean unorderedIsTrue() {
}

public static LogicNode tryConstantFold(CanonicalCondition condition, ValueNode forX, ValueNode forY, ConstantReflectionProvider constantReflection, boolean unorderedIsTrue) {
if (forX.isConstant() && forY.isConstant() && (constantReflection != null || forX.asConstant() instanceof PrimitiveConstant)) {
if (forX.isConstant() && forY.isConstant() && ((condition == CanonicalCondition.EQ && constantReflection != null) || forX.asConstant() instanceof PrimitiveConstant)) {
return LogicConstantNode.forBoolean(condition.foldCondition(forX.asConstant(), forY.asConstant(), constantReflection, unorderedIsTrue));
}
return null;
Expand Down

0 comments on commit fbe628e

Please sign in to comment.