Refine AALOAD handling in OptimizationBasicInterpreter
See comment in test data for clarifications #KT-13289 Fixed
This commit is contained in:
+16
@@ -65,6 +65,22 @@ public class OptimizationBasicInterpreter extends BasicInterpreter {
|
||||
return super.newOperation(insn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BasicValue binaryOperation(
|
||||
@NotNull AbstractInsnNode insn,
|
||||
@NotNull BasicValue value1,
|
||||
@NotNull BasicValue value2
|
||||
) throws AnalyzerException {
|
||||
if (insn.getOpcode() == Opcodes.AALOAD) {
|
||||
Type arrayType = value1.getType();
|
||||
if (arrayType != null && arrayType.getSort() == Type.ARRAY) {
|
||||
return new BasicValue(arrayType.getElementType());
|
||||
}
|
||||
}
|
||||
|
||||
return super.binaryOperation(insn, value1, value2);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public BasicValue merge(
|
||||
|
||||
Reference in New Issue
Block a user