about summary refs log tree commit diff homepage
path: root/lib/Core/SpecialFunctionHandler.cpp
diff options
context:
space:
mode:
authorJulian Büning <julian.buening@comsys.rwth-aachen.de>2020-12-17 14:17:29 +0100
committerCristian Cadar <c.cadar@imperial.ac.uk>2021-02-16 18:37:16 +0000
commit5f08b024bef12c3312d1e75f2c2ec5e5f5e0361f (patch)
treef3398bb7f5fc5fdcc3b35f0947399219a481cf5f /lib/Core/SpecialFunctionHandler.cpp
parentdbe3e458d3e25fb092a5468a8fe551a6e7486aed (diff)
downloadklee-5f08b024bef12c3312d1e75f2c2ec5e5f5e0361f.tar.gz
add ifdefs for C++ exception handling
restoring old behavior without EH support
Diffstat (limited to 'lib/Core/SpecialFunctionHandler.cpp')
-rw-r--r--lib/Core/SpecialFunctionHandler.cpp8
1 files changed, 7 insertions, 1 deletions
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<ref<Expr>> &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,