diff --git a/Phosphor/src/main/java/edu/columbia/cs/psl/phosphor/mask/ReflectionHidingMV.java b/Phosphor/src/main/java/edu/columbia/cs/psl/phosphor/mask/ReflectionHidingMV.java index 4c8e038b1..4cacd360a 100644 --- a/Phosphor/src/main/java/edu/columbia/cs/psl/phosphor/mask/ReflectionHidingMV.java +++ b/Phosphor/src/main/java/edu/columbia/cs/psl/phosphor/mask/ReflectionHidingMV.java @@ -74,6 +74,13 @@ public void visitMethodInsn(int opcode, String owner, String name, String desc, maskUnsafe(opcode, owner, name, desc, isInterface, descWithoutStackFrame); return; default: + MaskInfo mask = MaskRegistry.getMask(owner, name, desc); + if (mask != null) { + if (!name.equals("defineClass") || patchAnonymousClasses) { + mask.accept(mv); + return; + } + } super.visitMethodInsn(opcode, owner, name, desc, isInterface); fixReturn(owner, name, name, descWithoutStackFrame); } @@ -81,13 +88,6 @@ public void visitMethodInsn(int opcode, String owner, String name, String desc, private void maskUnsafe( int opcode, String owner, String name, String desc, boolean isInterface, String descWithoutStackFrame) { - MaskInfo mask = MaskRegistry.getMask(owner, name, desc); - if (mask != null) { - if (!name.equals("defineClass") || patchAnonymousClasses) { - mask.accept(mv); - return; - } - } if (patchAnonymousClasses && name.equals("defineAnonymousClass") && descWithoutStackFrame.equals("(Ljava/lang/Class;[B[Ljava/lang/Object;)Ljava/lang/Class;")) {