diff options
author | Julian Büning <julian.buening@rwth-aachen.de> | 2018-10-01 10:33:34 +0200 |
---|---|---|
committer | Cristian Cadar <c.cadar@imperial.ac.uk> | 2019-05-30 09:45:21 +0100 |
commit | 4b93a3ecf7514d181730f5a8f8bfe7e086160b4c (patch) | |
tree | 50b6509e86f449d6ab2ef8c867c5ff776433c1f3 /lib | |
parent | abf654288c2f7f0ee6e1dd3e34b70c1aabe82ea7 (diff) | |
download | klee-4b93a3ecf7514d181730f5a8f8bfe7e086160b4c.tar.gz |
remove klee_alias_function()
this function can be used to modify the control flow of the program on different paths, enabling self-modifying code.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Core/ExecutionState.cpp | 8 | ||||
-rw-r--r-- | lib/Core/SpecialFunctionHandler.cpp | 15 | ||||
-rw-r--r-- | lib/Core/SpecialFunctionHandler.h | 1 |
3 files changed, 0 insertions, 24 deletions
diff --git a/lib/Core/ExecutionState.cpp b/lib/Core/ExecutionState.cpp index 70d5d21c..48154383 100644 --- a/lib/Core/ExecutionState.cpp +++ b/lib/Core/ExecutionState.cpp @@ -173,14 +173,6 @@ std::string ExecutionState::getFnAlias(std::string fn) { else return ""; } -void ExecutionState::addFnAlias(std::string old_fn, std::string new_fn) { - fnAliases[old_fn] = new_fn; -} - -void ExecutionState::removeFnAlias(std::string fn) { - fnAliases.erase(fn); -} - /**/ llvm::raw_ostream &klee::operator<<(llvm::raw_ostream &os, const MemoryMap &mm) { diff --git a/lib/Core/SpecialFunctionHandler.cpp b/lib/Core/SpecialFunctionHandler.cpp index e18d3534..231bd88d 100644 --- a/lib/Core/SpecialFunctionHandler.cpp +++ b/lib/Core/SpecialFunctionHandler.cpp @@ -108,7 +108,6 @@ static SpecialFunctionHandler::HandlerInfo handlerInfo[] = { add("klee_stack_trace", handleStackTrace, false), add("klee_warning", handleWarning, false), add("klee_warning_once", handleWarningOnce, false), - add("klee_alias_function", handleAliasFunction, false), add("malloc", handleMalloc, true), add("memalign", handleMemalign, true), add("realloc", handleRealloc, true), @@ -299,20 +298,6 @@ void SpecialFunctionHandler::handleSilentExit(ExecutionState &state, executor.terminateState(state); } -void SpecialFunctionHandler::handleAliasFunction(ExecutionState &state, - KInstruction *target, - std::vector<ref<Expr> > &arguments) { - assert(arguments.size()==2 && - "invalid number of arguments to klee_alias_function"); - std::string old_fn = readStringAtAddress(state, arguments[0]); - std::string new_fn = readStringAtAddress(state, arguments[1]); - KLEE_DEBUG_WITH_TYPE("alias_handling", llvm::errs() << "Replacing " << old_fn - << "() with " << new_fn << "()\n"); - if (old_fn == new_fn) - state.removeFnAlias(old_fn); - else state.addFnAlias(old_fn, new_fn); -} - void SpecialFunctionHandler::handleAssert(ExecutionState &state, KInstruction *target, std::vector<ref<Expr> > &arguments) { diff --git a/lib/Core/SpecialFunctionHandler.h b/lib/Core/SpecialFunctionHandler.h index fdb6b6de..e041a3e4 100644 --- a/lib/Core/SpecialFunctionHandler.h +++ b/lib/Core/SpecialFunctionHandler.h @@ -111,7 +111,6 @@ namespace klee { HANDLER(handleDeleteArray); HANDLER(handleExit); HANDLER(handleErrnoLocation); - HANDLER(handleAliasFunction); HANDLER(handleFree); HANDLER(handleGetErrno); HANDLER(handleGetObjSize); |