From b64b96f721edc32bb806ef182f8097053585685d Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Fri, 17 Jan 2014 10:42:15 +0100 Subject: Make KLEE fail in case main function is missing Existence of main() function is checked with assertion. This check fails if KLEE is compiled in Release mode. --- lib/Module/KModule.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/Module') diff --git a/lib/Module/KModule.cpp b/lib/Module/KModule.cpp index 34e5f60c..2ecb14b8 100644 --- a/lib/Module/KModule.cpp +++ b/lib/Module/KModule.cpp @@ -182,7 +182,8 @@ static void injectStaticConstructorsAndDestructors(Module *m) { if (ctors || dtors) { Function *mainFn = m->getFunction("main"); - assert(mainFn && "unable to find main function"); + if (!mainFn) + klee_error("Could not find main() function."); if (ctors) CallInst::Create(getStubFunctionForCtorList(m, ctors, "klee.ctor_stub"), -- cgit 1.4.1