From c37e33f70556f544f608cdf970119001fb8d92e4 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 12 Sep 2014 19:18:28 -0700 Subject: [Core] Fix some warnings in -Asserts builds. --- lib/Core/Executor.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lib/Core') diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp index f31d6aeb..2f57ad95 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp @@ -81,8 +81,9 @@ #include "llvm/ADT/StringExtras.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/CommandLine.h" -#include "llvm/Support/raw_ostream.h" +#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/Process.h" +#include "llvm/Support/raw_ostream.h" #include #include @@ -955,7 +956,8 @@ Executor::fork(ExecutionState ¤t, ref condition, bool isInternal) { void Executor::addConstraint(ExecutionState &state, ref condition) { if (ConstantExpr *CE = dyn_cast(condition)) { - assert(CE->isTrue() && "attempt to add invalid constraint"); + if (!CE->isTrue()) + llvm::report_fatal_error("attempt to add invalid constraint"); return; } @@ -1042,7 +1044,7 @@ ref Executor::evalConstant(const Constant *c) { return cast(res); } else { // Constant{Vector} - assert(0 && "invalid argument to evalConstant()"); + llvm::report_fatal_error("invalid argument to evalConstant()"); } } } @@ -1745,9 +1747,6 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) { // Special instructions case Instruction::Select: { - SelectInst *SI = cast(ki->inst); - assert(SI->getCondition() == SI->getOperand(0) && - "Wrong operand index!"); ref cond = eval(ki, 0, state).value; ref tExpr = eval(ki, 1, state).value; ref fExpr = eval(ki, 2, state).value; -- cgit 1.4.1