mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 05:10:22 +07:00
EA-59392 (NPE: ControlFlowAnalyzer.visitPostfixExpression)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -1505,12 +1505,14 @@ class ControlFlowAnalyzer extends JavaElementVisitor {
|
||||
|
||||
IElementType op = expression.getOperationTokenType();
|
||||
PsiExpression operand = PsiUtil.skipParenthesizedExprDown(expression.getOperand());
|
||||
operand.accept(this);
|
||||
if (op == JavaTokenType.PLUSPLUS || op == JavaTokenType.MINUSMINUS) {
|
||||
if (operand instanceof PsiReferenceExpression) {
|
||||
PsiVariable variable = getUsedVariable((PsiReferenceExpression)operand);
|
||||
if (variable != null) {
|
||||
generateWriteInstruction(variable);
|
||||
if (operand != null) {
|
||||
operand.accept(this);
|
||||
if (op == JavaTokenType.PLUSPLUS || op == JavaTokenType.MINUSMINUS) {
|
||||
if (operand instanceof PsiReferenceExpression) {
|
||||
PsiVariable variable = getUsedVariable((PsiReferenceExpression)operand);
|
||||
if (variable != null) {
|
||||
generateWriteInstruction(variable);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,5 +90,6 @@ class T1 {
|
||||
++(<error descr="Variable 'i2' might not have been initialized">i2</error>);
|
||||
<error descr="Variable 'i3' might not have been initialized">i3</error> += 1;
|
||||
(i4) = 1;
|
||||
(<error descr="Expression expected">)</error>++;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user