From 5f08b024bef12c3312d1e75f2c2ec5e5f5e0361f Mon Sep 17 00:00:00 2001 From: Julian Büning Date: Thu, 17 Dec 2020 14:17:29 +0100 Subject: add ifdefs for C++ exception handling restoring old behavior without EH support --- lib/Core/SpecialFunctionHandler.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/Core/SpecialFunctionHandler.cpp') diff --git a/lib/Core/SpecialFunctionHandler.cpp b/lib/Core/SpecialFunctionHandler.cpp index f101a085..27ca385c 100644 --- a/lib/Core/SpecialFunctionHandler.cpp +++ b/lib/Core/SpecialFunctionHandler.cpp @@ -18,6 +18,7 @@ #include "StatsTracker.h" #include "TimingSolver.h" +#include "klee/Config/config.h" #include "klee/Module/KInstruction.h" #include "klee/Module/KModule.h" #include "klee/Solver/SolverCmdLine.h" @@ -115,7 +116,11 @@ static SpecialFunctionHandler::HandlerInfo handlerInfo[] = { add("malloc", handleMalloc, true), add("memalign", handleMemalign, true), add("realloc", handleRealloc, true), + +#ifdef SUPPORT_KLEE_EH_CXX add("_klee_eh_Unwind_RaiseException_impl", handleEhUnwindRaiseExceptionImpl, false), + add("klee_eh_typeid_for", handleEhTypeid, true), +#endif // operator delete[](void*) add("_ZdaPv", handleDeleteArray, false), @@ -140,7 +145,6 @@ static SpecialFunctionHandler::HandlerInfo handlerInfo[] = { add("__ubsan_handle_sub_overflow", handleSubOverflow, false), add("__ubsan_handle_mul_overflow", handleMulOverflow, false), add("__ubsan_handle_divrem_overflow", handleDivRemOverflow, false), - add("klee_eh_typeid_for", handleEhTypeid, true), #undef addDNR #undef add @@ -458,6 +462,7 @@ void SpecialFunctionHandler::handleMemalign(ExecutionState &state, alignment); } +#ifdef SUPPORT_KLEE_EH_CXX void SpecialFunctionHandler::handleEhUnwindRaiseExceptionImpl( ExecutionState &state, KInstruction *target, std::vector> &arguments) { @@ -495,6 +500,7 @@ void SpecialFunctionHandler::handleEhTypeid(ExecutionState &state, executor.bindLocal(target, state, executor.getEhTypeidFor(arguments[0])); } +#endif // SUPPORT_KLEE_EH_CXX void SpecialFunctionHandler::handleAssume(ExecutionState &state, KInstruction *target, -- cgit 1.4.1