Package dk.brics.string.intermediate

Examples of dk.brics.string.intermediate.VariableType


        // handle only fields declared in application classes
        if (!reference.getField().getDeclaringClass().isApplicationClass()) {
            return null;
        }

        VariableType type = factory.fromSootType(reference.getType());
        Variable var = factory.createVariable(type);
        Field field = factory.getField(reference.getField());
        factory.addStatement(new FieldReference(field, var));
       
        return var;
View Full Code Here


  }
 
  public Field getField(SootField sootField) {
    Field field = fields.get(sootField);
    if (field == null) {
      VariableType type = jt.fromSootType(sootField.getType());
      field = application.createField(type, sootField.isStatic());
      fields.put(sootField, field);
    }
    return field;
  }
View Full Code Here

 
  @Override
  public Variable caseArrayRef(ArrayRef v, ValueBox box) {
    // read something from an array
    Variable arrayObject = translateExpression(v.getBaseBox());
    VariableType innerType = getType(v.getType());
   
    if (innerType == VariableType.NONE)
      return getNothing();
   
    Variable result = makeVariable(innerType);
View Full Code Here

  }
 
  @Override
  public Variable caseCastExpr(CastExpr v, ValueBox box) {
    Variable operand = translateExpression(v.getOpBox());
    VariableType castTo = getType(v.getCastType());
   
    // whatever comes out of the cast must satisfy both the operand's type and the casted type
    VariableType resultType = operand.getType().greatestLowerBound(castTo);
    if (resultType == VariableType.NONE) {
      return getNothing();
    }
   
    // if a primitive cast is performed, assume nothing about the result
View Full Code Here

        if (result != null)
            return result;
    }
       
        // create a variable with the result
        VariableType returnType = getType(method.getReturnType());
        Variable result = makeVariable(returnType);
       
        // split the control-flow graph for each possible target
    factory.startBranch();
   
View Full Code Here

    if (goodResult != null) {
      assignValue(result, goodResult);
    } else {
      // if the method declaring the method might be an interesting mutable type,
      // corrupt the callee
      VariableType declaringClass = factory.fromSootType(target.getDeclaringClass().getType());
      handleCorruptInvocation(result, declaringClass, callee, arguments);
    }
  }
View Full Code Here

  public Variable caseStaticFieldRef(StaticFieldRef v, ValueBox box) {
      return handleFieldRef(v, box);
  }
 
  private Variable handleFieldRef(FieldRef v, ValueBox box) {
      VariableType type = factory.fromSootType(v.getType());
        if (type == VariableType.NONE)
            return getNothing();
       
        // if the field is @Type annotated, create a variable with its static type
        if (factory.fromSootType(v.getType()) == VariableType.STRING) {
View Full Code Here

      // only non-application methods may be resolved
      if (target.getDeclaringClass().isApplicationClass())
          return null;
     
    // Get the return type
    VariableType resultType = factory.fromSootType(target.getReturnType());
   
    MethodResolution resolution = getResolution(expr, target);
   
    // give up if no resolver could resolve the method
    if (resolution == null)
View Full Code Here

                    cfg.addStatement(assignment);
                }

                // corrupt externally visible fields
                if (ext.isExternallyVisibleField(field)) {
                    VariableType type = fromSootType(field
                            .getType());

                    if (type == VariableType.NONE)
                        continue;
View Full Code Here

     * the interesting types implement <tt>Serializable</tt>.
     * @param canonicalName fully qualified name of a Java class.
     * @return a variable type. <tt>NONE</tt> is (rightfully) returned for unknown types. <tt>null</tt> is never returned.
     */
    private static VariableType fromCanonicalName(String canonicalName) {
        VariableType type = javaTypesToVariableTypes.get(canonicalName);
        if (type == null)
            return VariableType.NONE;
        return type;
    }
View Full Code Here

TOP

Related Classes of dk.brics.string.intermediate.VariableType

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.