From bda35257b64545870c6de5fe8aba573ef82945d9 Mon Sep 17 00:00:00 2001 From: Julian Büning Date: Sat, 10 Oct 2020 15:13:40 +0200 Subject: Casting.h: isa_and_nonnull<> --- lib/Core/ExecutionState.cpp | 3 ++- lib/Core/Executor.cpp | 11 ++++++----- lib/Core/SpecialFunctionHandler.cpp | 5 +++-- 3 files changed, 11 insertions(+), 8 deletions(-) (limited to 'lib/Core') diff --git a/lib/Core/ExecutionState.cpp b/lib/Core/ExecutionState.cpp index 97f97a8b..47a3b3c6 100644 --- a/lib/Core/ExecutionState.cpp +++ b/lib/Core/ExecutionState.cpp @@ -16,6 +16,7 @@ #include "klee/Module/InstructionInfoTable.h" #include "klee/Module/KInstruction.h" #include "klee/Module/KModule.h" +#include "klee/Support/Casting.h" #include "klee/Support/OptionCategories.h" #include "llvm/IR/Function.h" @@ -342,7 +343,7 @@ void ExecutionState::dumpStack(llvm::raw_ostream &out) const { out << ai->getName().str(); // XXX should go through function ref value = sf.locals[sf.kf->getArgRegister(index++)].value; - if (value.get() && isa(value)) + if (isa_and_nonnull(value)) out << "=" << value; } out << ")"; diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp index 13c25076..a0df89f0 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp @@ -25,6 +25,7 @@ #include "TimingSolver.h" #include "UserSearcher.h" +#include "klee/ADT/KTest.h" #include "klee/ADT/RNG.h" #include "klee/Config/Version.h" #include "klee/Core/Interpreter.h" @@ -34,20 +35,20 @@ #include "klee/Expr/ExprPPrinter.h" #include "klee/Expr/ExprSMTLIBPrinter.h" #include "klee/Expr/ExprUtil.h" -#include "klee/Solver/Common.h" -#include "klee/ADT/KTest.h" -#include "klee/Support/OptionCategories.h" -#include "klee/Statistics/TimerStatIncrementer.h" #include "klee/Module/Cell.h" #include "klee/Module/InstructionInfoTable.h" #include "klee/Module/KInstruction.h" #include "klee/Module/KModule.h" +#include "klee/Solver/Common.h" #include "klee/Solver/SolverCmdLine.h" #include "klee/Solver/SolverStats.h" +#include "klee/Statistics/TimerStatIncrementer.h" +#include "klee/Support/Casting.h" #include "klee/Support/ErrorHandling.h" #include "klee/Support/FileHandling.h" #include "klee/Support/FloatEvaluation.h" #include "klee/Support/ModuleUtil.h" +#include "klee/Support/OptionCategories.h" #include "klee/System/MemoryUsage.h" #include "klee/System/Time.h" @@ -1651,7 +1652,7 @@ ref Executor::getEhTypeidFor(ref type_info) { void Executor::executeCall(ExecutionState &state, KInstruction *ki, Function *f, std::vector> &arguments) { Instruction *i = ki->inst; - if (i && isa(i)) + if (isa_and_nonnull(i)) return; if (f && f->isDeclaration()) { switch (f->getIntrinsicID()) { diff --git a/lib/Core/SpecialFunctionHandler.cpp b/lib/Core/SpecialFunctionHandler.cpp index 153619d3..f101a085 100644 --- a/lib/Core/SpecialFunctionHandler.cpp +++ b/lib/Core/SpecialFunctionHandler.cpp @@ -21,6 +21,7 @@ #include "klee/Module/KInstruction.h" #include "klee/Module/KModule.h" #include "klee/Solver/SolverCmdLine.h" +#include "klee/Support/Casting.h" #include "klee/Support/Debug.h" #include "klee/Support/ErrorHandling.h" #include "klee/Support/OptionCategories.h" @@ -471,8 +472,8 @@ void SpecialFunctionHandler::handleEhUnwindRaiseExceptionImpl( return; } - if (state.unwindingInformation && - isa(state.unwindingInformation.get())) { + if (isa_and_nonnull( + state.unwindingInformation.get())) { executor.terminateStateOnExecError( state, "Internal error: Unwinding restarted during an ongoing search phase"); -- cgit 1.4.1