Search in sources :

Example 1 with InvokeExpr

use of com.googlecode.dex2jar.ir.expr.InvokeExpr in project dex2jar by pxb1988.

the class AggTransformer method localCanExecFirst.

/**
     * dfs searching, if local is appear before first location-insensitive value, throws SUCCESS, or throws FAIL
     */
private static void localCanExecFirst(Local local, Value op) throws MergeResult {
    switch(op.et) {
        case E0:
            if (local.vt == Value.VT.LOCAL) {
                if (op == local) {
                    throw SUCCESS;
                }
            }
            break;
        case E1:
            localCanExecFirst(local, op.getOp());
            break;
        case E2:
            localCanExecFirst(local, op.getOp1());
            localCanExecFirst(local, op.getOp2());
            break;
        case En:
            for (Value v : op.getOps()) {
                localCanExecFirst(local, v);
            }
    }
    boolean shouldExclude = false;
    if (op.vt == Value.VT.INVOKE_STATIC) {
        InvokeExpr ie = (InvokeExpr) op;
        if (ie.name.equals("valueOf") && ie.owner.startsWith("Ljava/lang/") && ie.args.length == 1 && ie.args[0].length() == 1) {
            shouldExclude = true;
        }
    }
    if (!isLocationInsensitive(op.vt) && !shouldExclude) {
        // this is the first insensitive Value
        throw FAIL;
    }
}
Also used : InvokeExpr(com.googlecode.dex2jar.ir.expr.InvokeExpr) Value(com.googlecode.dex2jar.ir.expr.Value)

Aggregations

InvokeExpr (com.googlecode.dex2jar.ir.expr.InvokeExpr)1 Value (com.googlecode.dex2jar.ir.expr.Value)1