about summary refs log tree commit diff homepage
path: root/lib
diff options
context:
space:
mode:
authorAndrea Mattavelli <andreamattavelli@users.noreply.github.com>2017-03-05 21:48:14 +0000
committerGitHub <noreply@github.com>2017-03-05 21:48:14 +0000
commit930cd1750857111e7cc08812e148cb228f70e1b8 (patch)
tree32cc61d638c11a24c96b6a3023799c03995ab354 /lib
parentc8be670e87d18585def659c99b3c0429a84d020c (diff)
parentf89cdd04911e4acc9c045f2de6d1f50acec8e271 (diff)
downloadklee-930cd1750857111e7cc08812e148cb228f70e1b8.tar.gz
Merge pull request #607 from jirislaby/dispatcher
Core: MCJIT functions need unique names
Diffstat (limited to 'lib')
-rw-r--r--lib/Core/ExternalDispatcher.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Core/ExternalDispatcher.cpp b/lib/Core/ExternalDispatcher.cpp
index 01c5f935..984e3ab2 100644
--- a/lib/Core/ExternalDispatcher.cpp
+++ b/lib/Core/ExternalDispatcher.cpp
@@ -207,10 +207,11 @@ Function *ExternalDispatcher::createDispatcher(Function *target, Instruction *in
 
   std::vector<LLVM_TYPE_Q Type*> nullary;
   
+  // MCJIT functions need unique names, or wrong function can be called
   Function *dispatcher = Function::Create(FunctionType::get(Type::getVoidTy(ctx),
 							    nullary, false),
 					  GlobalVariable::ExternalLinkage, 
-					  "",
+					  "dispatcher_" + target->getName().str(),
 					  dispatchModule);