mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
CommonDataflow: support array access expressions
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.codeInspection.dataFlow;
|
||||
|
||||
import com.intellij.codeInspection.dataFlow.instructions.ArrayAccessInstruction;
|
||||
import com.intellij.codeInspection.dataFlow.instructions.BinopInstruction;
|
||||
import com.intellij.codeInspection.dataFlow.instructions.MethodCallInstruction;
|
||||
import com.intellij.codeInspection.dataFlow.instructions.PushInstruction;
|
||||
@@ -97,6 +98,17 @@ public class CommonDataflow {
|
||||
return states;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DfaInstructionState[] visitArrayAccess(ArrayAccessInstruction instruction, DataFlowRunner runner, DfaMemoryState memState) {
|
||||
DfaInstructionState[] states = super.visitArrayAccess(instruction, runner, memState);
|
||||
PsiArrayAccessExpression anchor = instruction.getExpression();
|
||||
for (DfaInstructionState state : states) {
|
||||
DfaMemoryState afterState = state.getMemoryState();
|
||||
dfr.add(anchor, (DfaMemoryStateImpl)afterState, afterState.peek());
|
||||
}
|
||||
return states;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DfaInstructionState[] visitBinop(BinopInstruction instruction, DataFlowRunner runner, DfaMemoryState memState) {
|
||||
DfaInstructionState[] states = super.visitBinop(instruction, runner, memState);
|
||||
|
||||
Reference in New Issue
Block a user