本文整理汇总了Java中soot.jimple.CastExpr.getCastType方法的典型用法代码示例。如果您正苦于以下问题:Java CastExpr.getCastType方法的具体用法?Java CastExpr.getCastType怎么用?Java CastExpr.getCastType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类soot.jimple.CastExpr
的用法示例。
在下文中一共展示了CastExpr.getCastType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: caseCastExpr
import soot.jimple.CastExpr; //导入方法依赖的package包/类
public void caseCastExpr(CastExpr expr) {
result = result.add(mgr.RESOLVE_CLASS_ERRORS);
Type fromType = expr.getOp().getType();
Type toType = expr.getCastType();
if (toType instanceof RefLikeType) {
// fromType might still be unknown when we are called,
// but toType will have a value.
FastHierarchy h = Scene.v().getOrMakeFastHierarchy();
if (fromType == null || fromType instanceof UnknownType ||
((! (fromType instanceof NullType)) &&
(! h.canStoreType(fromType, toType)))) {
result = result.add(mgr.CLASS_CAST_EXCEPTION);
}
}
result = result.add(mightThrow(expr.getOp()));
}
示例2: caseCastExpr
import soot.jimple.CastExpr; //导入方法依赖的package包/类
@Override
public void caseCastExpr(CastExpr ce) {
Type castType = ce.getCastType();
Value source = ce.getOp();
constantV.setOrigStmt(origStmt);
Register sourceReg = regAlloc.asImmediate(source, constantV);
if (SootToDexUtils.isObject(castType)) {
castObject(sourceReg, castType);
} else {
castPrimitive(sourceReg, source, castType);
}
}
示例3: caseCastExpr
import soot.jimple.CastExpr; //导入方法依赖的package包/类
@Override
public void caseCastExpr(CastExpr v) {
if (v.getCastType() instanceof ArrayType) {
throw new CastInvalidException(getMsg("exception.analysis.other.cast",
v.getOp().toString()));
}
handleUnaryExpr(v.getOp());
}
示例4: pass1
import soot.jimple.CastExpr; //导入方法依赖的package包/类
void pass1()
{ int count = method.getParameterCount();
Local[] locals = SootUtilities.getMethArgLocals(method);
if(locals == null)
return;
if(!method.isStatic()) {
thisVar = locals[0];
paramVars = new Local[locals.length - 1];
for(int i=1; i<locals.length; i++){
paramVars[i-1] = locals[i];
}
}
else{
paramVars = new Local[locals.length];
for(int i=0; i<locals.length; i++){
paramVars[i] = locals[i];
}
}
if(count > 0){
int j = 0;
for(Type pType : method.getParameterTypes()){
if(pType instanceof PrimType){
if(paramVars != null)
domU.add(paramVars[j], method);
j++;
}
}
}
Type retType = method.getReturnType();
if(!(retType instanceof VoidType)){
retVar = SootUtilities.getReturnLocal(method);
if(retType instanceof PrimType && retVar!= null)
domU.add(retVar,method);
}
if(!method.isConcrete())
return;
Body body = method.retrieveActiveBody();
LocalsClassifier lc = new LocalsClassifier(body);
primLocals = lc.primLocals();
nonPrimLocals = lc.nonPrimLocals();
for(Local l : body.getLocals()){
boolean isPrim = primLocals.contains(l);
if(isPrim)
domU.add(l,method);
}
stmtToCastNode = new HashMap();
for(Unit unit : body.getUnits()){
Stmt s = (Stmt) unit;
if(s instanceof AssignStmt) {
Value rightOp = ((AssignStmt) s).getRightOp();
if(rightOp instanceof CastExpr){
CastExpr castExpr = (CastExpr) rightOp;
Type castType = castExpr.getCastType();
if(castType instanceof RefLikeType){ //TODO
stmtToCastNode.put(s, castExpr);
}
}
}
}
}