Ejemplo n.º 1
0
// Call, Assert, Branch
void Executor::ExecuteInst1(Instruction *i, Value *val) {

    assert(i && "Expecting an instruction!");
    assert(val && "Expecting a value!");
    assert(status==START && "Wrong status for Executor (!=START)!");
    ExprPtr expr = NULL;
    switch (i->getOpcode()) {
        case Instruction::GetElementPtr:
            //executeGep(i);
            if (!DisabledSymbolicExe) {
                expr = PathEncoder->encode(cast<GetElementPtrInst>(i));
            }
            break;
        case Instruction::Store:
            executeStore(i, val);
            if (!DisabledSymbolicExe) {
                expr = PathEncoder->encode(cast<StoreInst>(i));
            }
            break;
        case Instruction::Load:
            executeLoad(i, val);
            if (!DisabledSymbolicExe) {
                expr = PathEncoder->encode(cast<LoadInst>(i), PathFormula);
            }
            break;
        case Instruction::PHI:
            executePhi(i);
            if (!DisabledSymbolicExe) {
                expr = PathEncoder->encode(cast<PHINode>(i), LastExecutedBB);
            }
            break;
        case Instruction::Br: {
            ConstantInt *CI = dyn_cast<ConstantInt>(val);
            assert(CI && "Unsupported value!");
            const bool cond = CI->getSExtValue();
            executeBranch(i, cond);
        } break;
        // TODO
        case Instruction::Call:
            executeCall(i, 0, 0);
            break;
        default:    
            assert("test-executor");
    }
    if (expr && !DisabledSymbolicExeCurRun) {
        expr->setHard();
        PathFormula->add(expr);
    }
}
bool RundownDeckLinkInputWidget::executeCommand(enum Playout::PlayoutType::Type type)
{
    if (type == Playout::PlayoutType::Stop)
        QTimer::singleShot(0, this, SLOT(executeStop()));
    else if (type == Playout::PlayoutType::Play)
        QTimer::singleShot(this->command.getDelay(), this, SLOT(executePlay()));
    else if (type == Playout::PlayoutType::Load)
        QTimer::singleShot(0, this, SLOT(executeLoad()));
    else if (type == Playout::PlayoutType::Clear)
        QTimer::singleShot(0, this, SLOT(executeClear()));
    else if (type == Playout::PlayoutType::ClearVideolayer)
        QTimer::singleShot(0, this, SLOT(executeClearVideolayer()));
    else if (type == Playout::PlayoutType::ClearChannel)
        QTimer::singleShot(0, this, SLOT(executeClearChannel()));

    return true;
}