[llvm] r201127 - In RuntimeDyldImpl::emitSection, make Allocate (section size to be allocated) a

Lang Hames lhames at gmail.com
Mon Feb 10 21:28:24 PST 2014


Author: lhames
Date: Mon Feb 10 23:28:24 2014
New Revision: 201127

URL: http://llvm.org/viewvc/llvm-project?rev=201127&view=rev
Log:
In RuntimeDyldImpl::emitSection, make Allocate (section size to be allocated) a
uintptr_t. An unsigned could overflow for large sections.

No test case - anything big enough to overflow an unsigned is going to take an
appreciable time to zero when the test passes.

The choice of uintptr_t was made to match the RTDyldMemoryManager APIs, but
these should probably be hardcoded to uint64_ts: It is legitimate to JIT for
64-bit targets from a 32-bit host/compiler.


Modified:
    llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp

Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp?rev=201127&r1=201126&r2=201127&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp Mon Feb 10 23:28:24 2014
@@ -298,7 +298,7 @@ unsigned RuntimeDyldImpl::emitSection(Ob
   if (Name == ".eh_frame")
     PaddingSize = 4;
 
-  unsigned Allocate;
+  uintptr_t Allocate;
   unsigned SectionID = Sections.size();
   uint8_t *Addr;
   const char *pData = 0;





More information about the llvm-commits mailing list