From 5b2dcbbcf91062e463a040d58302706c612f03bd Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Fri, 13 Dec 2013 19:07:30 +0000 Subject: Added a few comments to Executor::getLastNonKleeInternalInstruction() emphasising that the function cannot be returned from early. --- lib/Core/Executor.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/Core') 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(); -- cgit 1.4.1