From 248962b92ffa409d11122d2504e84567c7c34354 Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 10 Jun 2008 20:48:36 +0000 Subject: [PATCH] guard 155347 --- weaver/src/org/aspectj/weaver/patterns/IfPointcut.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/patterns/IfPointcut.java b/weaver/src/org/aspectj/weaver/patterns/IfPointcut.java index 304c26056..0e61b5eda 100644 --- a/weaver/src/org/aspectj/weaver/patterns/IfPointcut.java +++ b/weaver/src/org/aspectj/weaver/patterns/IfPointcut.java @@ -24,6 +24,7 @@ import org.aspectj.lang.JoinPoint; import org.aspectj.util.FuzzyBoolean; import org.aspectj.weaver.Advice; import org.aspectj.weaver.AjcMemberMaker; +import org.aspectj.weaver.BCException; import org.aspectj.weaver.ISourceContext; import org.aspectj.weaver.IntMap; import org.aspectj.weaver.ResolvedMember; @@ -173,7 +174,10 @@ public class IfPointcut extends Pointcut { // is bindings for the arguments residueSource.findResidue(shadow, myState); - + UnresolvedType[] pTypes = (testMethod==null?null:testMethod.getParameterTypes()); + if (pTypes!=null && baseArgsCount>pTypes.length) { //pr155347 + throw new BCException("Unexpected problem with testMethod "+testMethod+": expecting "+baseArgsCount+" arguments"); + } // pr118149 // It is possible for vars in myState (which would normally be set // in the call to residueSource.findResidue) to not be set (be null) @@ -186,7 +190,7 @@ public class IfPointcut extends Pointcut { args.add(v); ret = Test.makeAnd(ret, Test.makeInstanceof(v, - testMethod.getParameterTypes()[i].resolve(shadow.getIWorld()))); + pTypes[i].resolve(shadow.getIWorld()))); } } -- 2.39.5