mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-dfa] Fix imbalanced stack on incomplete guarded pattern
Fixes EA-447737 - ESE: Stack.pop (at least some cases linked to this exception) GitOrigin-RevId: 5709b7fc22e9495e07f20f899cb66274b0443fc0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
60a8572183
commit
a3eced1e77
+2
@@ -1085,6 +1085,8 @@ public class ControlFlowAnalyzer extends JavaElementVisitor {
|
||||
PsiExpression expression = ((PsiGuardedPattern)innerPattern).getGuardingExpression();
|
||||
if (expression != null) {
|
||||
expression.accept(this);
|
||||
} else {
|
||||
addInstruction(new PushValueInstruction(DfTypes.BOOLEAN));
|
||||
}
|
||||
DeferredOffset condGotoOffset = new DeferredOffset();
|
||||
addInstruction(new ConditionalGotoInstruction(condGotoOffset, DfTypes.TRUE));
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
class Test {
|
||||
int testIncomplete(Object obj) {
|
||||
return switch(obj) {
|
||||
case String s &&<EOLError descr="Expression expected"></EOLError><EOLError descr="':' expected"></EOLError>
|
||||
};
|
||||
}
|
||||
|
||||
void test1(Object o) {
|
||||
int a;
|
||||
switch (o) {
|
||||
|
||||
Reference in New Issue
Block a user