File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
llvm/include/llvm/ExecutionEngine/Orc Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ class OrcRPCTPCJITLinkMemoryManager : public jitlink::JITLinkMemoryManager {
59
59
auto I = HostAllocs.find (Seg);
60
60
assert (I != HostAllocs.end () && " No host allocation for segment" );
61
61
auto &HA = I->second ;
62
- return {HA.Mem .get (), HA.Size };
62
+ return {HA.Mem .get (), static_cast < size_t >( HA.Size ) };
63
63
}
64
64
65
65
JITTargetAddress getTargetMemory (ProtectionFlags Seg) override {
@@ -153,6 +153,9 @@ class OrcRPCTPCJITLinkMemoryManager : public jitlink::JITLinkMemoryManager {
153
153
HostAllocMap HostAllocs;
154
154
155
155
for (auto &KV : Request) {
156
+ assert (KV.second .getContentSize () <= std::numeric_limits<size_t >::max () &&
157
+ " Content size is out-of-range for host" );
158
+
156
159
RMR.push_back ({orcrpctpc::toWireProtectionFlags (
157
160
static_cast <sys::Memory::ProtectionFlags>(KV.first )),
158
161
KV.second .getContentSize () + KV.second .getZeroFillSize (),
You can’t perform that action at this time.
0 commit comments