public JAssignStmt(Value variable, Value rvalue) { this(new LinkedVariableBox(variable), new LinkedRValueBox(rvalue)); ((LinkedVariableBox) leftBox).setOtherBox(rightBox); ((LinkedRValueBox) rightBox).setOtherBox(leftBox); if (!leftBox.canContainValue(variable) || !rightBox.canContainValue(rvalue)) { throw new RuntimeException( "Illegal assignment statement. Make sure that either left side or right hand side has a local or constant."); } }
if (use instanceof Local) { Constant constant = localToConstant.get(use); if (useBox.canContainValue(constant)) { useBox.setValue(constant);
Value defSrc = defSrcBox.getValue(); if (defSrcBox.canContainValue(constant)) { defSrcBox.setValue(constant); ValueBox useBox = pair.getValueBox(); if (useBox.canContainValue(constant)) { useBox.setValue(constant); } else if (debug) {
if (usepair.valueBox.canContainValue(aggregatee)) { boolean wasSimpleCopy = isSimpleCopy(usepair.unit); usepair.valueBox.setValue(aggregatee);
public void checkAndSwitch(ValueBox valBox) { Value val = valBox.getValue(); Object finalField = check(val); if (finalField != null) { // System.out.println("Final field with this value exists"+finalField); /* * If the final field belongs to the same class then we should supress declaring class */ SootField field = (SootField) finalField; if (sootClass.declaresField(field.getName(), field.getType())) { // this field is of this class so supress the declaring class if (valBox.canContainValue(new DStaticFieldRef(field.makeRef(), true))) { valBox.setValue(new DStaticFieldRef(field.makeRef(), true)); } } else { if (valBox.canContainValue(new DStaticFieldRef(field.makeRef(), true))) { valBox.setValue(new DStaticFieldRef(field.makeRef(), false)); } } } // else // System.out.println("Final field not found"); }
if (useBox.canContainValue(def.getRightOp())) { useBox.setValue(def.getRightOp()); isConstNull |= ce.getOp() instanceof LongConstant && ((LongConstant) ce.getOp()).value == 0; if (isConstNull) { if (useBox.canContainValue(NullConstant.v())) { useBox.setValue(NullConstant.v());
Value rhs = defStmt.getRightOp(); if (rhs instanceof NumericConstant || rhs instanceof StringConstant || rhs instanceof NullConstant) { if (useBox.canContainValue(rhs)) { useBox.setValue(rhs); numPropagated++; if (Evaluator.isValueConstantValued(value)) { Value constValue = Evaluator.getConstantValueOf(value); if (useBox.canContainValue(constValue)) { useBox.setValue(constValue); numFolded++;
public JAssignStmt(Value variable, Value rvalue) { leftBox = new LinkedVariableBox(variable); rightBox = new LinkedRValueBox(rvalue); ((LinkedVariableBox)leftBox).setOtherBox(rightBox); ((LinkedRValueBox)rightBox).setOtherBox(leftBox); if(!leftBox.canContainValue(variable) || !rightBox.canContainValue(rvalue)) throw new RuntimeException("Illegal assignment statement. Make sure that either left side or right hand side has a local or constant."); defBoxes = new SingletonList(leftBox); }
public JAssignStmt(Value variable, Value rvalue) { leftBox = new LinkedVariableBox(variable); rightBox = new LinkedRValueBox(rvalue); ((LinkedVariableBox)leftBox).setOtherBox(rightBox); ((LinkedRValueBox)rightBox).setOtherBox(leftBox); if(!leftBox.canContainValue(variable) || !rightBox.canContainValue(rvalue)) throw new RuntimeException("Illegal assignment statement. Make sure that either left side or right hand side has a local or constant."); defBoxes = new SingletonList(leftBox); }
if (usepair.valueBox.canContainValue(aggregatee))
if (usepair.valueBox.canContainValue(aggregatee))
(DefinitionStmt) defsOfUse.get(0); if (defStmt.getRightOp() instanceof NumericConstant) { if (useBox.canContainValue(defStmt.getRightOp())) { useBox.setValue(defStmt.getRightOp()); numPropagated++; Value constValue = Evaluator.getConstantValueOf(value); if (useBox.canContainValue(constValue)) { useBox.setValue(constValue); numFolded++;
(DefinitionStmt) defsOfUse.get(0); if (defStmt.getRightOp() instanceof NumericConstant) { if (useBox.canContainValue(defStmt.getRightOp())) { useBox.setValue(defStmt.getRightOp()); numPropagated++; Value constValue = Evaluator.getConstantValueOf(value); if (useBox.canContainValue(constValue)) { useBox.setValue(constValue); numFolded++;