Closed
Description
In a 32-bit process running on a 64-bit operating system, it's possible to allocate a Vec<u8>
of length 1u32 << 31
or greater. The maximum value where uint as int
produces a positive number is (1u32 << 31) - 1)
, so int
is not large enough for offset
operations to the end of these vectors. Everything from the language's built-in slice indexing operations to the push
method on Vec<T>
will perform an invalid negative (backwards) offset as the getelementptr
instruction uses a signed offset.