Package soot.jimple.internal

Examples of soot.jimple.internal.JAssignStmt


          Stmt s1 = (Stmt) u;
          List<Unit> succs = mbug.getSuccsOf(s1);
          if (succs.size() == 1) {
            Stmt s2 = (Stmt) succs.get(0);
            if (s1 instanceof JAssignStmt && s2 instanceof JInvokeStmt && mbug.getPredsOf(s2).size() == 1) {
              JAssignStmt js1 = (JAssignStmt) s1;
              JInvokeStmt js2 = (JInvokeStmt) s2;
              if (js1.containsInvokeExpr()
                  && (js1.getInvokeExpr().getMethod().getSignature().equals("<dk.brics.xact.XML: java.util.Map getNamespaceMap()>")
                      || js1.getInvokeExpr().getMethod().getSignature().equals("<dk.brics.xact.XML: java.util.Map getThreadNamespaceMap()>"))
                  && js2.getInvokeExpr().getMethod().getSignature().equals("<java.util.Map: java.lang.Object put(java.lang.Object,java.lang.Object)>")
                  && js1.getDefBoxes().size() == 1 && js1.getDefBoxes().get(0) instanceof AbstractValueBox
                  && js2.getInvokeExpr() instanceof JInterfaceInvokeExpr) {
                Value v = ((AbstractValueBox) js1.getDefBoxes().get(0)).getValue();
                JInterfaceInvokeExpr put = (JInterfaceInvokeExpr) js2.getInvokeExpr();
                if (put.getBase().equivTo(v)) {
                  Origin origin = new Origin(m.getDeclaringClass().getName() + "." + m.getName(), getLineNumber(u), 0);
                  String prefix = getConstantString(put.getArg(0), origin);
                  String uri = getConstantString(put.getArg(1), origin);
View Full Code Here


                initMethod.retrieveActiveBody());
        for (Unit aGraph : graph) {
            assert aGraph instanceof Stmt;
            Stmt st = (Stmt) aGraph;
            if (st instanceof JAssignStmt) {
                JAssignStmt jAssignStmt = (JAssignStmt) st;
                Value right = jAssignStmt.getRightOp();
                if (right instanceof JNewExpr) {
                    JNewExpr newInstance = (JNewExpr) right;
                    SootClass constructedClass = newInstance.getBaseType()
                            .getSootClass();
                    if (isWebApp(constructedClass)) {
View Full Code Here

            // find the actual type of the locals
            Local local = (Local) value;
            List<Unit> defsOfAt = simpleLocalDefs.getDefsOfAt(local, st);
            for (Unit unit : defsOfAt) {
                if (unit instanceof JAssignStmt) {
                    JAssignStmt assign = (JAssignStmt) unit;
                    values.add(assign.getRightOp());
                } else if (unit instanceof JIdentityStmt) {
                    JIdentityStmt identity = (JIdentityStmt) unit;
                    values.add(identity.getRightOp());
                } else {
                    throw new RuntimeException(
View Full Code Here

        boolean skipAnalysis = false;
        for (Unit unit : graph) {
            assert unit instanceof Stmt;
            Stmt statement = (Stmt) unit;
            if (statement instanceof JAssignStmt) {
                JAssignStmt jAssignStmt = (JAssignStmt) statement;
                if (jAssignStmt.getLeftOp().equals(varArgs)) {
                    // assigning to the varArgs variable
                    log.debug("Found varargs instantiation");

                    VarArgInfo varArgInfo = getVarArgInfo(jAssignStmt);
                    if (varArgInfo != null) {
                        varArgSize = varArgInfo.getSize();
                        varArgTypes = varArgInfo.getTypes();
                        varArgBase = varArgInfo.getBaseType();
                    } else {
                        Feedbacks.add(new UnanalyzedVarArgs(enclosingMethod,
                                enclosingStatement));
                        // we cant do anything, but to skip this analysis
                        skipAnalysis = true;
                        break;
                    }
                } else if (!skipAnalysis
                        && jAssignStmt.getLeftOp() instanceof JArrayRef) {
                    JArrayRef jArrayRef = (JArrayRef) jAssignStmt.getLeftOp();
                    if (jArrayRef.getBase().equals(varArgs)) {
                        // assigning to the varArg array values. Compute
                        // the type at the assigned position. This will always
                        // happen after the varargs instantiation!

                        if (jArrayRef.getIndex() instanceof IntConstant) {
                            IntConstant intConstant = (IntConstant) jArrayRef
                                    .getIndex();
                            int index = intConstant.value;
                            Type oldType = varArgTypes[index];
                            Type type = jAssignStmt.getRightOp().getType();
                            if (oldType instanceof RefType
                                    && type instanceof RefType) {
                                RefType refType = (RefType) oldType;
                                RefType refType2 = (RefType) type;
                                type = resolver.getLeastCommonSupertypeOf(
View Full Code Here

        Set<Type> types = new HashSet<Type>();
        List<Unit> defsOfAt = simpleLocalDefs.getDefsOfAt(local, st);
        for (Unit unit : defsOfAt) {
            Value value;
            if (unit instanceof JAssignStmt) {
                JAssignStmt assign = (JAssignStmt) unit;
                value = assign.getRightOp();
            } else if (unit instanceof JIdentityStmt) {
                JIdentityStmt identity = (JIdentityStmt) unit;
                value = identity.getRightOp();
            } else {
                throw new RuntimeException(
View Full Code Here

TOP

Related Classes of soot.jimple.internal.JAssignStmt

Copyright © 2018 www.massapicom. 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.