aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorDan Liew <daniel.liew@imperial.ac.uk>2013-12-13 19:07:30 +0000
committerDan Liew <daniel.liew@imperial.ac.uk>2013-12-19 15:45:04 +0000
commit5b2dcbbcf91062e463a040d58302706c612f03bd (patch)
treeb4dd1cdbf0b93f48b47918bab6f494a3b20966c0 /lib
parentcca3536a76d877c5441e54e093a5808cd05c4f86 (diff)
downloadklee-5b2dcbbcf91062e463a040d58302706c612f03bd.tar.gz
Added a few comments to Executor::getLastNonKleeInternalInstruction()
emphasising that the function cannot be returned from early.
Diffstat (limited to 'lib')
-rw-r--r--lib/Core/Executor.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
index 767a5602..bf672bb7 100644
--- a/lib/Core/Executor.cpp
+++ b/lib/Core/Executor.cpp
@@ -2743,9 +2743,14 @@ const InstructionInfo & Executor::getLastNonKleeInternalInstruction(const Execut
if (kmodule->internalFunctions.count(it->kf->function) == 0){
ii = state.prevPC->info;
*lastInstruction = state.prevPC->inst;
+ // Cannot return yet because even though
+ // it->function is not an internal function it might of
+ // been called from an internal function.
}
- // wind up the stack and check if we are in a KLEE internal function
+ // Wind up the stack and check if we are in a KLEE internal function.
+ // We visit the entire stack because we want to return a CallInstruction
+ // that was not reached via any KLEE internal functions.
for (;it != itE; ++it) {
// check calling instruction and if it is contained in a KLEE internal function
const Function * f = (*it->caller).inst->getParent()->getParent();