about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorDan Liew <daniel.liew@imperial.ac.uk>2015-10-17 15:45:29 +0100
committerDan Liew <daniel.liew@imperial.ac.uk>2015-10-17 15:45:29 +0100
commit50b9e95064a8a312c365fda57ed5729cd91706ba (patch)
treef6edd692ad4c378258824731f116c7ba90ded437
parent20bf195f8a4da5e2e17c59b01b11da8917ee4a8c (diff)
downloadklee-50b9e95064a8a312c365fda57ed5729cd91706ba.tar.gz
Some SV-COMP benchmarks provide an existing implementation of
``__VERIFIER_assert()`` which conflicts with ours. Remove their
implementation if it is detected.
-rw-r--r--lib/Module/KModule.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Module/KModule.cpp b/lib/Module/KModule.cpp
index e22b3d24..f3487baf 100644
--- a/lib/Module/KModule.cpp
+++ b/lib/Module/KModule.cpp
@@ -374,6 +374,16 @@ void KModule::prepare(const Interpreter::ModuleOptions &opts,
 #else
     runtimeFileName += ".bca";
 #endif
+
+    // Some SV-COMP benchmarks might provide their own implementation of
+    // __VERIFIER functions. Remove them
+    llvm::Function* existingVERIFIER_assert = module->getFunction("__VERIFIER_assert");
+    if (existingVERIFIER_assert) {
+      existingVERIFIER_assert->deleteBody();
+      klee_warning("Deleting existing implementation of %s", existingVERIFIER_assert->getName().data());
+    }
+
+
     llvm::sys::path::append(LibPath, runtimeFileName.str());
     module = linkWithLibrary(module, LibPath.str());