diff --git a/llvm/tools/llvm-exegesis/lib/InMemoryAssembler.h b/llvm/tools/llvm-exegesis/lib/InMemoryAssembler.h index 11c5df0f477f..51b555f54537 100644 --- a/llvm/tools/llvm-exegesis/lib/InMemoryAssembler.h +++ b/llvm/tools/llvm-exegesis/lib/InMemoryAssembler.h @@ -23,6 +23,7 @@ #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/IR/LLVMContext.h" #include "llvm/MC/MCInst.h" +#include #include #include @@ -67,7 +68,7 @@ public: // Retrieves the callable function. void operator()() const { char* const FnData = const_cast(FunctionBytes.data()); - ((void (*)())FnData)(); + ((void (*)())(intptr_t)FnData)(); } private: