mirror of
https://github.com/alibaba/testable-mock.git
synced 2025-02-05 01:01:02 +08:00
fix issue cause by iinc bytecode
This commit is contained in:
parent
3c375713aa
commit
a6b289e136
@ -72,7 +72,9 @@ public class TestClassHandler extends BaseClassHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (AbstractInsnNode in : mn.instructions) {
|
for (AbstractInsnNode in : mn.instructions) {
|
||||||
if (in.getOpcode() >= ILOAD && in.getOpcode() <= SASTORE && in instanceof VarInsnNode) {
|
if (in instanceof IincInsnNode) {
|
||||||
|
((IincInsnNode)in).var--;
|
||||||
|
} else if (in instanceof VarInsnNode) {
|
||||||
if (((VarInsnNode)in).var > 0) {
|
if (((VarInsnNode)in).var > 0) {
|
||||||
((VarInsnNode)in).var--;
|
((VarInsnNode)in).var--;
|
||||||
} else if (in.getOpcode() == ALOAD) {
|
} else if (in.getOpcode() == ALOAD) {
|
||||||
|
Loading…
Reference in New Issue
Block a user