Examples of MLFAStatePair


Examples of dk.brics.string.mlfa.MLFAStatePair

        propagateTaint(r);

        for (Node n : nodes) {
            Nonterminal nt = f2g.getNonterminal(n);
            MLFAStatePair sp = gm.getMLFAStatePair(nt);
            if (nt.isTaint()) {
                sp.setTaint(true);
            }
        }
        log.debug(mlfa.toString());

        // Make map
        map = new HashMap<ValueBox, MLFAStatePair>();
        for (ValueBox box : hotspots) {
            Node n = m3.get(m2.get(m1.get(box)));
            if (n != null) {
                Nonterminal nt = f2g.getNonterminal(n);
                MLFAStatePair sp = gm.getMLFAStatePair(nt);
                map.put(box, sp);
            }
        }
        tostring_map = new HashMap<SootClass, MLFAStatePair>();
        Map<SootClass, StringStatement> tostring_hotspot_map = jt.getToStringHotspotMap();
        for (Map.Entry<SootClass, StringStatement> tse : tostring_hotspot_map.entrySet()) {
            SootClass tsc = tse.getKey();
            StringStatement ss = tse.getValue();
            Node n = m3.get(m2.get(ss));
            if (n != null) {
                Nonterminal nt = f2g.getNonterminal(n);
                MLFAStatePair sp = gm.getMLFAStatePair(nt);
                tostring_map.put(tsc, sp);
            }
        }
        sourcefile_map = jt.getSourceFileMap();
        class_map = jt.getClassNameMap();
View Full Code Here

Examples of dk.brics.string.mlfa.MLFAStatePair

            return getTypeAutomaton(box.getValue().getType());
        }
        if (!map.containsKey(box)) {
            throw new IllegalArgumentException("Expression is not a marked hotspot");
        }
        MLFAStatePair sp = map.get(box);
        return mlfa2aut.extract(sp);
    }
View Full Code Here

Examples of dk.brics.string.mlfa.MLFAStatePair

    /**
     * Returns whether the strings that this valuebox contains can be taint.
     * The strategy is defined by {@link dk.brics.string.java.TaintAnalysisStrategy}.
     */
    public boolean isTaint(ValueBox box) {
        MLFAStatePair sp = map.get(box);
        return sp.isTaint();
    }
View Full Code Here

Examples of dk.brics.string.mlfa.MLFAStatePair

            return ta;
        }
        if (t instanceof RefType) {
            SootClass c = ((RefType) t).getSootClass();
            if (tostring_map.containsKey(c)) {
                MLFAStatePair sp = tostring_map.get(c);
                return mlfa2aut.extract(sp);
            }
        }
        return Basic.makeAnyString();
    }
View Full Code Here

Examples of dk.brics.string.mlfa.MLFAStatePair

    /**
     * Returns MLFA state pair representing initial and final state for the given nonterminal.
     * {@link #convert()} must be called first.
     */
    public MLFAStatePair getMLFAStatePair(Nonterminal n) {
        MLFAStatePair p;
        Component c = comp.getComponent(n);
        if (c.getRecursion() == Recursion.RIGHT || c.getRecursion() == Recursion.NONE) {
            p = new MLFAStatePair(nt_states[n.getKey()], c.getState());
        } else {
            p = new MLFAStatePair(c.getState(), nt_states[n.getKey()]);
        }
        p.setTaint(n.isTaint());
        return p;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.