From 01bd676df7d3c725c79539d7f7ed96033d327558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=91=E6=88=9F?= Date: Tue, 16 Feb 2021 18:27:27 +0800 Subject: [PATCH] aload 0 should be kept --- .../com/alibaba/testable/agent/handler/MockClassHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testable-agent/src/main/java/com/alibaba/testable/agent/handler/MockClassHandler.java b/testable-agent/src/main/java/com/alibaba/testable/agent/handler/MockClassHandler.java index 9a51840..20319a7 100644 --- a/testable-agent/src/main/java/com/alibaba/testable/agent/handler/MockClassHandler.java +++ b/testable-agent/src/main/java/com/alibaba/testable/agent/handler/MockClassHandler.java @@ -66,7 +66,7 @@ public class MockClassHandler extends BaseClassWithContextHandler { for (AbstractInsnNode in : mn.instructions) { if (in instanceof IincInsnNode) { ((IincInsnNode)in).var++; - } else if (in instanceof VarInsnNode) { + } else if (in instanceof VarInsnNode && ((VarInsnNode)in).var > 0) { ((VarInsnNode)in).var++; } }