From a6b289e136118f01b084373f2ee9579ce7b982e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=91=E6=88=9F?= Date: Mon, 28 Dec 2020 14:43:08 +0800 Subject: [PATCH] fix issue cause by iinc bytecode --- .../com/alibaba/testable/agent/handler/TestClassHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testable-agent/src/main/java/com/alibaba/testable/agent/handler/TestClassHandler.java b/testable-agent/src/main/java/com/alibaba/testable/agent/handler/TestClassHandler.java index ad9b55e..376602f 100644 --- a/testable-agent/src/main/java/com/alibaba/testable/agent/handler/TestClassHandler.java +++ b/testable-agent/src/main/java/com/alibaba/testable/agent/handler/TestClassHandler.java @@ -72,7 +72,9 @@ public class TestClassHandler extends BaseClassHandler { return; } 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) { ((VarInsnNode)in).var--; } else if (in.getOpcode() == ALOAD) {