DfaBinOpValue.Factory.doCreate: more robust check (IDEA-CR-58001)

GitOrigin-RevId: 4528899a106b324f1f970ca9d48e206da5af8a41
This commit is contained in:
Tagir Valeev
2020-02-04 18:28:46 +07:00
committed by intellij-monorepo-bot
parent df38bd569e
commit 8b6f3c1fa7

View File

@@ -179,8 +179,9 @@ public class DfaBinOpValue extends DfaValue {
return doCreate((DfaVariableValue)left, right, isLong, BinOp.PLUS);
}
}
if (left instanceof DfaBinOpValue && ((DfaBinOpValue)left).myOp != BinOp.REM) {
if (left instanceof DfaBinOpValue) {
DfaBinOpValue sumValue = (DfaBinOpValue)left;
if (sumValue.getOperation() != BinOp.PLUS && sumValue.getOperation() != BinOp.MINUS) return null;
if (rightConst != null) {
if (sumValue.getRight() instanceof DfaTypeValue) {
long value1 = extractLong((DfaTypeValue)sumValue.getRight());