Skip to content

Commit

Permalink
Raise exception when ModifyVariable handler args incorrect, closes Sp…
Browse files Browse the repository at this point in the history
  • Loading branch information
Mumfrey committed Jan 18, 2018
1 parent 569a0bc commit 9a08917
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,13 @@ protected void inject(Target target, InjectionNode node) {
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) {
Expand Down

0 comments on commit 9a08917

Please sign in to comment.