Search in sources :

Example 1 with ThrowStmt

use of org.mapleir.ir.code.stmt.ThrowStmt in project maple-ir by LLVM-but-worse.

the class SSAGenPass method checkCloneHandler.

private boolean checkCloneHandler(BasicBlock b) {
    if (b.isEmpty())
        throw new IllegalArgumentException("empty block after split?");
    // backwards iteration is faster
    for (ListIterator<Stmt> it = b.listIterator(b.size()); it.hasPrevious(); ) {
        Stmt stmt = it.previous();
        if (stmt instanceof CopyVarStmt) {
            CopyVarStmt copy = (CopyVarStmt) stmt;
            int opc = copy.getExpression().getOpcode();
            if (!copy.isSynthetic() && opc != Opcode.LOCAL_LOAD && opc != Opcode.CATCH)
                return true;
        } else if (stmt.canChangeFlow()) {
            if (stmt instanceof ThrowStmt)
                return true;
        // no need to check child exprs as no complex subexprs can occur before propagation.
        } else {
            return true;
        }
    }
    return false;
}
Also used : CopyVarStmt(org.mapleir.ir.code.stmt.copy.CopyVarStmt) ThrowStmt(org.mapleir.ir.code.stmt.ThrowStmt) Constraint(org.mapleir.ir.cfg.builder.ssaopt.Constraint) SwitchStmt(org.mapleir.ir.code.stmt.SwitchStmt) CopyVarStmt(org.mapleir.ir.code.stmt.copy.CopyVarStmt) PopStmt(org.mapleir.ir.code.stmt.PopStmt) ThrowStmt(org.mapleir.ir.code.stmt.ThrowStmt) UnconditionalJumpStmt(org.mapleir.ir.code.stmt.UnconditionalJumpStmt) Stmt(org.mapleir.ir.code.Stmt) CopyPhiStmt(org.mapleir.ir.code.stmt.copy.CopyPhiStmt) ConditionalJumpStmt(org.mapleir.ir.code.stmt.ConditionalJumpStmt) AbstractCopyStmt(org.mapleir.ir.code.stmt.copy.AbstractCopyStmt)

Aggregations

Constraint (org.mapleir.ir.cfg.builder.ssaopt.Constraint)1 Stmt (org.mapleir.ir.code.Stmt)1 ConditionalJumpStmt (org.mapleir.ir.code.stmt.ConditionalJumpStmt)1 PopStmt (org.mapleir.ir.code.stmt.PopStmt)1 SwitchStmt (org.mapleir.ir.code.stmt.SwitchStmt)1 ThrowStmt (org.mapleir.ir.code.stmt.ThrowStmt)1 UnconditionalJumpStmt (org.mapleir.ir.code.stmt.UnconditionalJumpStmt)1 AbstractCopyStmt (org.mapleir.ir.code.stmt.copy.AbstractCopyStmt)1 CopyPhiStmt (org.mapleir.ir.code.stmt.copy.CopyPhiStmt)1 CopyVarStmt (org.mapleir.ir.code.stmt.copy.CopyVarStmt)1