diff options
author | Martin Nowack <martin@se.inf.tu-dresden.de> | 2014-01-17 10:42:15 +0100 |
---|---|---|
committer | Martin Nowack <martin@se.inf.tu-dresden.de> | 2014-01-17 10:42:15 +0100 |
commit | b64b96f721edc32bb806ef182f8097053585685d (patch) | |
tree | 4c8fa1e361095c23b5b8c7019f2efa30d8694013 /lib/Module | |
parent | 8c03dfa5ea9fe5176cbb82b70a36ffa93c70b91c (diff) | |
download | klee-b64b96f721edc32bb806ef182f8097053585685d.tar.gz |
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.
Diffstat (limited to 'lib/Module')
-rw-r--r-- | lib/Module/KModule.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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"), |