Search in sources :

Example 6 with ControlTaintTagStack

use of edu.columbia.cs.psl.phosphor.struct.ControlTaintTagStack in project phosphor by gmu-swe.

the class NativeHelper method ensureIsBoxedImplicitTracking.

@SuppressWarnings("rawtypes")
public static final Collection ensureIsBoxedImplicitTracking(Collection in) {
    if (in != null) {
        Collection tmp = null;
        for (Object o : in) {
            if (o == null)
                break;
            Type t = Type.getType(o.getClass());
            if (t.getSort() == Type.ARRAY && t.getElementType().getSort() != Type.OBJECT) {
                if (tmp == null) {
                    try {
                        tmp = (Collection) in.getClass().getConstructor().newInstance(null);
                    } catch (Exception ex) {
                        ex.printStackTrace();
                    }
                }
                tmp.add$$PHOSPHORTAGGED(MultiDTaintedArrayWithObjTag.boxIfNecessary(o), new ControlTaintTagStack(), new TaintedBooleanWithObjTag());
            } else
                break;
        }
        if (tmp != null) {
            in.clear();
            tmp.add$$PHOSPHORTAGGED(tmp, new ControlTaintTagStack(), new TaintedBooleanWithObjTag());
        }
    }
    return in;
}
Also used : ControlTaintTagStack(edu.columbia.cs.psl.phosphor.struct.ControlTaintTagStack) Type(org.objectweb.asm.Type) Collection(java.util.Collection) TaintedBooleanWithObjTag(edu.columbia.cs.psl.phosphor.struct.TaintedBooleanWithObjTag)

Aggregations

ControlTaintTagStack (edu.columbia.cs.psl.phosphor.struct.ControlTaintTagStack)6 Type (org.objectweb.asm.Type)3 TaggedValue (edu.columbia.cs.psl.phosphor.instrumenter.analyzer.TaggedValue)2 OffsetPreservingLabel (edu.columbia.cs.psl.phosphor.instrumenter.asm.OffsetPreservingLabel)2 TaintedBooleanWithObjTag (edu.columbia.cs.psl.phosphor.struct.TaintedBooleanWithObjTag)2 Collection (java.util.Collection)2 Label (org.objectweb.asm.Label)2 LazyArrayIntTags (edu.columbia.cs.psl.phosphor.struct.LazyArrayIntTags)1 LazyArrayObjTags (edu.columbia.cs.psl.phosphor.struct.LazyArrayObjTags)1 TaintedWithIntTag (edu.columbia.cs.psl.phosphor.struct.TaintedWithIntTag)1 TaintedWithObjTag (edu.columbia.cs.psl.phosphor.struct.TaintedWithObjTag)1 LocalVariableNode (org.objectweb.asm.tree.LocalVariableNode)1