From 53cd1b8951861c6d1befefc4140f1132dab1ca49 Mon Sep 17 00:00:00 2001 From: asie Date: Fri, 25 Jan 2019 10:07:46 +0100 Subject: [PATCH] fix minor bug in BeforeInvoke.find logic --- .../asm/mixin/injection/points/BeforeInvoke.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeInvoke.java b/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeInvoke.java index 343c84c6..d58c273a 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeInvoke.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/points/BeforeInvoke.java @@ -158,13 +158,15 @@ public class BeforeInvoke extends InjectionPoint { this.log("{} is searching for an injection point in method with descriptor {}", this.className, desc); boolean hasDescriptor = this.target instanceof ITargetSelectorByName && ((ITargetSelectorByName)this.target).getDesc() == null; - - if (!this.find(desc, insns, nodes, this.target, SearchType.STRICT) && hasDescriptor && this.allowPermissive) { + boolean found = this.find(desc, insns, nodes, this.target, SearchType.STRICT); + + if (!found && hasDescriptor && this.allowPermissive) { this.logger.warn("STRICT match for {} using \"{}\" in {} returned 0 results, attempting permissive search. " + "To inhibit permissive search set mixin.env.allowPermissiveMatch=false", this.className, this.target, this.context); - return this.find(desc, insns, nodes, this.target, SearchType.PERMISSIVE); + found = this.find(desc, insns, nodes, this.target, SearchType.PERMISSIVE); } - return true; + + return found; } protected boolean find(String desc, InsnList insns, Collection nodes, ITargetSelector selector, SearchType searchType) {