if(invoke.getMethodName(cpg).equals("<init>") && invoke.getClassName(cpg).equals("java.lang.String") && invoke.getSignature(cpg).equals("(Ljava/lang/String;)V")) { return getConstantLDC(h.getPrev(), cpg, clazz);
INVOKESPECIAL invoke = (INVOKESPECIAL) inst; if (("javax.crypto.spec.IvParameterSpec").equals(invoke.getClassName(cpg)) && "<init>".equals(invoke.getMethodName(cpg))) {
INVOKESPECIAL invoke = (INVOKESPECIAL) inst; if ("javax.servlet.http.Cookie".equals(invoke.getClassName(cpg)) && "<init>".equals(invoke.getMethodName(cpg))) {
if ((prevIns instanceof INVOKESPECIAL && Const.CONSTRUCTOR_NAME.equals(((INVOKESPECIAL) prevIns).getMethodName(methodGen.getConstantPool()))) || prevIns instanceof ANEWARRAY || prevIns instanceof NEWARRAY
public static String getCallMethodName(Instruction ins, ConstantPoolGen cp) { if (ins instanceof INVOKESTATIC) { INVOKESTATIC invst = (INVOKESTATIC) ins; return invst.getMethodName(cp); } else if (ins instanceof INVOKEVIRTUAL) { INVOKEVIRTUAL invst = (INVOKEVIRTUAL) ins; return invst.getMethodName(cp); } else if (ins instanceof INVOKEINTERFACE) { INVOKEINTERFACE invst = (INVOKEINTERFACE) ins; return invst.getMethodName(cp); } else if (ins instanceof INVOKESPECIAL) { INVOKESPECIAL invst = (INVOKESPECIAL) ins; return invst.getMethodName(cp); } else { return null; } }
if(invoke.getMethodName(cpg).equals("<init>") && invoke.getClassName(cpg).equals("java.lang.String") && invoke.getSignature(cpg).equals("(Ljava/lang/String;)V")) { return getConstantLDC(h.getPrev(), cpg, clazz);
if (Values.CONSTRUCTOR.equals(is.getMethodName(cpg))) { if ((rt instanceof ObjectType) && ((ObjectType) rt).getClassName().startsWith(clsContext.getJavaClass().getClassName() + Values.INNER_CLASS_SEPARATOR)) {
if (Values.CONSTRUCTOR.equals(is.getMethodName(cpg))) { if ((rt instanceof ObjectType) && ((ObjectType) rt).getClassName().startsWith(clsContext.getJavaClass().getClassName() + Values.INNER_CLASS_SEPARATOR)) {
Method m = null; for (int i=0; i<ms.length; i++){ if ( (ms[i].getName().equals(o.getMethodName(cpg))) && (Type.getReturnType(ms[i].getSignature()).equals(o.getReturnType(cpg))) && (objarrayequals(Type.getArgumentTypes(ms[i].getSignature()), o.getArgumentTypes(cpg))) ){ constraintViolated(o, "Referenced method '"+o.getMethodName(cpg)+"' with expected signature not found in class '"+jc.getClassName()+"'. The native verfier does allow the method to be declared in some superclass or implemented interface, which the Java Virtual Machine Specification, Second Edition does not."); if (! (o.getMethodName(cpg).equals(Constants.CONSTRUCTOR_NAME) )){ if ( (meths[i].getName().equals(o.getMethodName(cpg))) && (Type.getReturnType(meths[i].getSignature()).equals(o.getReturnType(cpg))) && (objarrayequals(Type.getArgumentTypes(meths[i].getSignature()), o.getArgumentTypes(cpg))) ){ constraintViolated(o, "ACC_SUPER special lookup procedure not successful: method '"+o.getMethodName(cpg)+"' with proper signature not declared in superclass hierarchy.");
if ("java.security.spec.RSAKeyGenParameterSpec".equals(invoke.getClassName(cpg)) && "<init>".equals(invoke.getMethodName(cpg))) { Number n = null;
/** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitINVOKESPECIAL(INVOKESPECIAL o){ if (o.getMethodName(cpg).equals(Constants.CONSTRUCTOR_NAME)){ UninitializedObjectType t = (UninitializedObjectType) stack().peek(o.getArgumentTypes(cpg).length); if (t == frame._this){ frame._this = null; } stack().initializeObject(t); locals().initializeObject(t); } stack().pop(); //objectref for (int i=0; i<o.getArgumentTypes(cpg).length; i++){ stack().pop(); } // We are sure the invoked method will xRETURN eventually // We simulate xRETURNs functionality here because we // don't really "jump into" and simulate the invoked // method. if (o.getReturnType(cpg) != Type.VOID){ Type t = o.getReturnType(cpg); if ( t.equals(Type.BOOLEAN) || t.equals(Type.CHAR) || t.equals(Type.BYTE) || t.equals(Type.SHORT) ) t = Type.INT; stack().push(t); } } /** Symbolically executes the corresponding Java Virtual Machine instruction. */
if ("java.security.spec.RSAKeyGenParameterSpec".equals(invoke.getClassName(cpg)) && "<init>".equals(invoke.getMethodName(cpg))) { Number n = null;
final Method m = getMethodRecursive(jc, o); if (m == null) { constraintViolated(o, "Referenced method '"+o.getMethodName(cpg)+"' with expected signature '"+o.getSignature(cpg) +"' not found in class '"+jc.getClassName()+"'."); if (! (o.getMethodName(cpg).equals(Const.CONSTRUCTOR_NAME) )) { if ( (meth2.getName().equals(o.getMethodName(cpg))) && (Type.getReturnType(meth2.getSignature()).equals(o.getReturnType(cpg))) && (objarrayequals(Type.getArgumentTypes(meth2.getSignature()), o.getArgumentTypes(cpg))) ) { o.getMethodName(cpg)+"' with proper signature not declared in superclass hierarchy.");
INVOKESPECIAL invoke = (INVOKESPECIAL) inst; if (("javax.crypto.spec.IvParameterSpec").equals(invoke.getClassName(cpg)) && "<init>".equals(invoke.getMethodName(cpg))) {
INVOKESPECIAL invoke = (INVOKESPECIAL) inst; if ("javax.servlet.http.Cookie".equals(invoke.getClassName(cpg)) && "<init>".equals(invoke.getMethodName(cpg))) {
if ( (o.getMethodName(cpg).equals(Constants.CONSTRUCTOR_NAME)) && (!(stack().peek(o.getArgumentTypes(cpg).length) instanceof UninitializedObjectType)) ){ constraintViolated(o, "Possibly initializing object twice. A valid instruction sequence must not have an uninitialized object on the operand stack or in a local variable during a backwards branch, or in a local variable in code protected by an exception handler. Please see The Java Virtual Machine Specification, Second Edition, 4.9.4 (pages 147 and 148) for details."); if ( !(o.getMethodName(cpg).equals(Constants.CONSTRUCTOR_NAME))){ referenceTypeIsInitialized(o, (ReferenceType) objref); if (!(objref instanceof ObjectType)){
try { if ( (o.getMethodName(cpg).equals(Const.CONSTRUCTOR_NAME)) && (!(stack().peek(o.getArgumentTypes(cpg).length) instanceof UninitializedObjectType)) ) { constraintViolated(o, "Possibly initializing object twice."+ if ( !(o.getMethodName(cpg).equals(Const.CONSTRUCTOR_NAME))) { referenceTypeIsInitialized(o, (ReferenceType) objref); if (!(objref instanceof ObjectType)) {
if (o.getMethodName(cpg).equals(Const.CONSTRUCTOR_NAME)) { final UninitializedObjectType t = (UninitializedObjectType) stack().peek(o.getArgumentTypes(cpg).length); if (t == Frame.getThis()) {
if ((prevIns instanceof INVOKESPECIAL && "<init>".equals(((INVOKESPECIAL) prevIns).getMethodName(methodGen.getConstantPool()))) || prevIns instanceof ANEWARRAY || prevIns instanceof NEWARRAY