[llvm] r259575 - [Orc] Stub addresses should be based on stub size, not pointer size.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 2 13:38:30 PST 2016


Author: lhames
Date: Tue Feb  2 15:38:30 2016
New Revision: 259575

URL: http://llvm.org/viewvc/llvm-project?rev=259575&view=rev
Log:
[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.


Modified:
    llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcArchitectureSupport.h

Modified: llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcArchitectureSupport.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcArchitectureSupport.h?rev=259575&r1=259574&r2=259575&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcArchitectureSupport.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcArchitectureSupport.h Tue Feb  2 15:38:30 2016
@@ -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<uint64_t *>(StubsMem.base()) + Idx;
+    return static_cast<char *>(StubsMem.base()) + Idx * StubSize;
   }
 
   /// @brief Get a pointer to the implementation-pointer at the given index,




More information about the llvm-commits mailing list