about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorMartin Nowack <martin@se.inf.tu-dresden.de>2013-11-13 23:01:12 +0100
committerMartin Nowack <martin@se.inf.tu-dresden.de>2013-11-13 23:01:12 +0100
commite134985e66571f88a574fd0a80ed2a4b991ca802 (patch)
tree9b4261b18d5e4e5ab98e138191ecc8bd69d4365a
parentf755e643e22cfcad5ebd95c88f02afe1044c1597 (diff)
downloadklee-e134985e66571f88a574fd0a80ed2a4b991ca802.tar.gz
Fix using assembler addresses for global variables
Format of assembler address strings are different
with newer LLVM version (They don't have a prefix anymore).

This fix takes care of newer LLVM versions (>=3.3) as well.
-rw-r--r--lib/Core/Executor.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
index b2cff8ba..6df8dd14 100644
--- a/lib/Core/Executor.cpp
+++ b/lib/Core/Executor.cpp
@@ -577,9 +577,17 @@ void Executor::initializeGlobals(ExecutionState &state) {
       uint64_t size = kmodule->targetData->getTypeStoreSize(ty);
       MemoryObject *mo = 0;
 
+#if LLVM_VERSION_CODE < LLVM_VERSION(3, 3)
       if (UseAsmAddresses && i->getName()[0]=='\01') {
+#else
+      if (UseAsmAddresses && !i->getName().empty()) {
+#endif
         char *end;
+#if LLVM_VERSION_CODE < LLVM_VERSION(3, 3)
         uint64_t address = ::strtoll(i->getName().str().c_str()+1, &end, 0);
+#else
+        uint64_t address = ::strtoll(i->getName().str().c_str(), &end, 0);
+#endif
 
         if (end && *end == '\0') {
           klee_message("NOTE: allocated global at asm specified address: %#08llx"