Raise exception when ModifyVariable handler args incorrect, closes #232

This commit is contained in:
Mumfrey committed 2018-01-18 12:50:47 +00:00
1 parent 569a0bcded
commit 9a089172be
1 file changed
+7 -1
@@ -148,7 +148,13 @@ public class ModifyVariableInjector extends Injector {
if (this.discriminator.printLVT()) {
this.printLocals(context);
}
String handlerDesc = Bytecode.getDescriptor(new Type[] { this.returnType }, this.returnType);
if (!handlerDesc.equals(this.methodNode.desc)) {
throw new InvalidInjectionException(this.info, "Variable modifier " + this + " has an invalid signature, expected " + handlerDesc
+ " but found " + this.methodNode.desc);
}
try {
int local = this.discriminator.findLocal(context);
if (local > -1) {