public ClassHierarchy(Singletons.Global g) { typeNodeMap.put(BooleanType.v(), BOOLEAN); typeNodeMap.put(ByteType.v(), BYTE); typeNodeMap.put(ShortType.v(), SHORT); typeNodeMap.put(CharType.v(), CHAR); typeNodeMap.put(IntType.v(), INT); }
public void caseArrayWriteInst(ArrayWriteInst i) { // RefType replaces the arraytype remove_types = new Type[] { RefType.v(), IntType.v(), i.getOpType() }; add_types = null; }
private Type byteCodeTypeOf(Type type) { if (type.equals(ShortType.v()) || type.equals(CharType.v()) || type.equals(ByteType.v()) || type.equals(BooleanType.v())) { return IntType.v(); } else { return type; } }
public void caseNewMultiArrayInst(NewMultiArrayInst i) { remove_types = new Type[i.getDimensionCount()]; for (int ii = 0; ii < remove_types.length; ii++) { remove_types[ii] = IntType.v(); } add_types = new Type[] { RefType.v() }; }
/** Converts the int-like types (short, byte, boolean and char) to IntType. */ public static Type toMachineType(Type t) { if (t.equals(ShortType.v()) || t.equals(ByteType.v()) || t.equals(BooleanType.v()) || t.equals(CharType.v())) { return IntType.v(); } else { return t; } }
public void caseFloatType(FloatType ty) { if (toType.equals(IntType.v())) { setResult("f2i"); } else if (toType.equals(LongType.v())) { setResult("f2l"); } else if (toType.equals(DoubleType.v())) { setResult("f2d"); } else { throw new RuntimeException("invalid toType from float: " + toType); } }
public void caseDoubleType(DoubleType ty) { if (toType.equals(IntType.v())) { setResult("d2i"); } else if (toType.equals(LongType.v())) { setResult("d2l"); } else if (toType.equals(FloatType.v())) { setResult("d2f"); } else { throw new RuntimeException("invalid toType from double: " + toType); } }
public void caseLongType(LongType ty) { if (toType.equals(IntType.v())) { setResult("l2i"); } else if (toType.equals(FloatType.v())) { setResult("l2f"); } else if (toType.equals(DoubleType.v())) { setResult("l2d"); } else { throw new RuntimeException("invalid toType from long: " + toType); } } });
@Override public void caseTableSwitchStmt(TableSwitchStmt stmt) { // add constraint DalvikTyper.v().setType(stmt.getKeyBox(), IntType.v(), true); }
public Local get_ControlLocal() { if (controlLocal == null) { controlLocal = new JimpleLocal("controlLocal", IntType.v()); getLocals().add(controlLocal); } return controlLocal; }
@Override public void caseLookupSwitchStmt(LookupSwitchStmt stmt) { // add constraint DalvikTyper.v().setType(stmt.getKeyBox(), IntType.v(), true); }
public void caseLookupSwitchStmt(LookupSwitchStmt stmt) { if (uses) { Value key = stmt.getKey(); if (key instanceof Local) { resolver.typeVariable((Local) key).addParent(resolver.typeVariable(IntType.v())); } } }
public void caseTableSwitchStmt(TableSwitchStmt stmt) { if (uses) { Value key = stmt.getKey(); if (key instanceof Local) { resolver.typeVariable((Local) key).addParent(resolver.typeVariable(IntType.v())); } } }
public void caseTableSwitchStmt(TableSwitchStmt stmt) { if (uses) { Value key = stmt.getKey(); if (key instanceof Local) { resolver.typeVariable((Local) key).addParent(resolver.typeVariable(IntType.v())); } } }
public void caseLookupSwitchStmt(LookupSwitchStmt stmt) { if (uses) { Value key = stmt.getKey(); if (key instanceof Local) { resolver.typeVariable((Local) key).addParent(resolver.typeVariable(IntType.v())); } } }
public Type getType() { if (getOp1().getType().equals(getOp2().getType())) { return getOp1().getType(); } return IntType.v(); } }
public Type getType() { if (getOp1().getType().equals(getOp2().getType())) { return getOp1().getType(); } return IntType.v(); } }
public Type getType() { if (getOp1().getType().equals(getOp2().getType())) { return getOp1().getType(); } return IntType.v(); } }
public void caseTableSwitchStmt(TableSwitchStmt stmt) { Value key = stmt.getKey(); if (key instanceof Local) { if (!hierarchy.typeNode(((Local) key).getType()).hasAncestorOrSelf(hierarchy.typeNode(IntType.v()))) { error("Type Error(52)"); } } }
public void caseLookupSwitchStmt(LookupSwitchStmt stmt) { Value key = stmt.getKey(); if (key instanceof Local) { if (!hierarchy.typeNode(((Local) key).getType()).hasAncestorOrSelf(hierarchy.typeNode(IntType.v()))) { error("Type Error(50)"); } } }