From f823e149afaac9da476659e7a7bdc4783ca67073 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Tue, 2 Feb 2016 21:38:30 +0000 Subject: [PATCH] [Orc] Stub addresses should be based on stub size, not pointer size. This didn't affect X86_64, which is the only client of this code at the moment, as stubs and pointers are both 8-bytes there. It will affect other platforms though. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259575 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ExecutionEngine/Orc/OrcArchitectureSupport.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/llvm/ExecutionEngine/Orc/OrcArchitectureSupport.h b/include/llvm/ExecutionEngine/Orc/OrcArchitectureSupport.h index b5ef28613f1..01558eee084 100644 --- a/include/llvm/ExecutionEngine/Orc/OrcArchitectureSupport.h +++ b/include/llvm/ExecutionEngine/Orc/OrcArchitectureSupport.h @@ -94,7 +94,7 @@ public: /// @brief Get a pointer to the stub at the given index, which must be in /// the range 0 .. getNumStubs() - 1. void *getStub(unsigned Idx) const { - return static_cast(StubsMem.base()) + Idx; + return static_cast(StubsMem.base()) + Idx * StubSize; } /// @brief Get a pointer to the implementation-pointer at the given index, -- 2.11.0