private static void mergeRealInstanceClass(Taint a, Taint b, Taint result) { if (a.realInstanceClass != null && b.realInstanceClass != null) { try { if (a.realInstanceClass.equals(b.realInstanceClass) || b.realInstanceClass.subclassOf(a.realInstanceClass)) { result.realInstanceClass = a.realInstanceClass; } else if (a.realInstanceClass.subclassOf(b.realInstanceClass)) { result.realInstanceClass = b.realInstanceClass; } } catch (ClassNotFoundException ex) { AnalysisContext.reportMissingClass(ex); } } }
private static void mergeRealInstanceClass(Taint a, Taint b, Taint result) { if (a.realInstanceClass != null && b.realInstanceClass != null) { try { if (a.realInstanceClass.equals(b.realInstanceClass) || b.realInstanceClass.subclassOf(a.realInstanceClass)) { result.realInstanceClass = a.realInstanceClass; } else if (a.realInstanceClass.subclassOf(b.realInstanceClass)) { result.realInstanceClass = b.realInstanceClass; } } catch (ClassNotFoundException ex) { AnalysisContext.reportMissingClass(ex); } } }
/** * Ensures the specific preconditions of the said instruction. */ public void visitATHROW(ATHROW o){ // It's stated that 'objectref' must be of a ReferenceType --- but since Throwable is // not derived from an ArrayType, it follows that 'objectref' must be of an ObjectType or Type.NULL. if (! ((stack().peek() instanceof ObjectType) || (stack().peek().equals(Type.NULL))) ){ constraintViolated(o, "The 'objectref' is not of an (initialized) ObjectType but of type "+stack().peek()+"."); } // NULL is a subclass of every class, so to speak. if (stack().peek().equals(Type.NULL)) return; ObjectType exc = (ObjectType) (stack().peek()); ObjectType throwable = (ObjectType) (Type.getType("Ljava/lang/Throwable;")); if ( (! (exc.subclassOf(throwable)) ) && (! (exc.equals(throwable))) ){ constraintViolated(o, "The 'objectref' is not of class Throwable or of a subclass of Throwable, but of '"+stack().peek()+"'."); } }
curr.subclassOf(classtype) ){ Type t = stack().peek(); if (t == Type.NULL){ objreftype.subclassOf(curr) ) ){
curr.subclassOf(classtype) ) { final Type t = stack().peek(); if (t == Type.NULL) { objreftype.subclassOf(curr) ) ) {
curr.subclassOf(classtype) ){ Type tp = stack().peek(1); if (tp == Type.NULL){ objreftype.subclassOf(curr) ) ){ constraintViolated(o, "The referenced field has the ACC_PROTECTED modifier, and it's a member of the current class or a superclass of the current class. However, the referenced object type '"+stack().peek()+"' is not the current class or a subclass of the current class.");
/** * Ensures the specific preconditions of the said instruction. */ @Override public void visitATHROW(final ATHROW o) { try { // It's stated that 'objectref' must be of a ReferenceType --- but since Throwable is // not derived from an ArrayType, it follows that 'objectref' must be of an ObjectType or Type.NULL. if (! ((stack().peek() instanceof ObjectType) || (stack().peek().equals(Type.NULL))) ) { constraintViolated(o, "The 'objectref' is not of an (initialized) ObjectType but of type "+stack().peek()+"."); } // NULL is a subclass of every class, so to speak. if (stack().peek().equals(Type.NULL)) { return; } final ObjectType exc = (ObjectType) (stack().peek()); final ObjectType throwable = (ObjectType) (Type.getType("Ljava/lang/Throwable;")); if ( (! (exc.subclassOf(throwable)) ) && (! (exc.equals(throwable))) ) { constraintViolated(o, "The 'objectref' is not of class Throwable or of a subclass of Throwable, but of '"+stack().peek()+"'."); } } catch (final ClassNotFoundException e) { // FIXME: maybe not the best way to handle this throw new AssertionViolatedException("Missing class: " + e, e); } }
curr.subclassOf(classtype) ) { final Type tp = stack().peek(1); if (tp == Type.NULL) { objreftype.subclassOf(curr) ) ) { constraintViolated(o, "The referenced field has the ACC_PROTECTED modifier, and it's a member of the current class or"+