Skip to content
Commit 47e5399c authored by Pete Cooper's avatar Pete Cooper
Browse files

Fix more cases of UB from allocating 0 sized data. NFC.

The size of a section can be zero, even when it contains atoms, so
long as all of the atoms are also size 0.  In this case we were
allocating space for a 0 sized buffer.

Changed this to only allocate when we need the space, but also cleaned
up all the code to use MutableArrayRef instead of uint8_t* so its much much
safer as we get bounds checking on all of our section creation logic.

llvm-svn: 264204
parent 08087c52
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment