mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-dfa] Properly balance stack when increment/decrement variable is unresolved
Found by property tests GitOrigin-RevId: 581bc8d7a12cc43037a3936126a68cdf3678e884
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6f250ab078
commit
5504efe286
+2
@@ -2172,6 +2172,8 @@ public class ControlFlowAnalyzer extends JavaElementVisitor {
|
||||
}
|
||||
PsiPrimitiveType unboxedType = PsiPrimitiveType.getOptionallyUnboxedType(operandType);
|
||||
if (unboxedType == null) {
|
||||
// Unknown type; likely erroneous code: replace old_value with unknown
|
||||
addInstruction(new PopInstruction());
|
||||
pushUnknown();
|
||||
} else {
|
||||
generateBoxingUnboxingInstructionFor(operand, unboxedType);
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import java.util.*;
|
||||
|
||||
class Test {
|
||||
|
||||
void test(int last)
|
||||
{
|
||||
for (; <error descr="Cannot resolve symbol 'i'">i</error> < last; <error descr="Cannot resolve symbol 'i'">i</error>++) {
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
@@ -89,4 +89,5 @@ public class DataFlowRangeAnalysisTest extends DataFlowInspectionTestCase {
|
||||
public void testFloatingPointCasts() { doTest(); }
|
||||
public void testFloatingPointMaxLoop() { doTest(); }
|
||||
public void testStringIndexOfRelation() { doTest(); }
|
||||
public void testIncompleteLoop() { doTest(); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user