diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp index 83923a2b8e3..41b3ebcc6db 100644 --- a/lib/ExecutionEngine/JIT/JIT.cpp +++ b/lib/ExecutionEngine/JIT/JIT.cpp @@ -446,6 +446,7 @@ GenericValue JIT::runFunction(Function *F, CallInst *TheCall = CallInst::Create(F, Args.begin(), Args.end(), "", StubBB); + TheCall->setCallingConv(F->getCallingConv()); TheCall->setTailCall(); if (TheCall->getType() != Type::VoidTy) ReturnInst::Create(TheCall, StubBB); // Return result of the call.