Generate tags for heap allocations from a pseudo-random sequence
seeded with getrandom(), where available.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
compiler-rt/lib/hwasan/hwasan_thread.cc | ||
---|---|---|
100 ↗ | (On Diff #128304) | GetRandom and xorshift can result in 0, right? Maybe this and drop CHECK: if (!random_buffer_) { random_state_ = xorshift(random_state_); while (!random_state) random_state = RandomSeed(); random_buffer_ = random_state_; } |
Comment Actions
avoid zero random seed
compiler-rt/lib/hwasan/hwasan_thread.cc | ||
---|---|---|
100 ↗ | (On Diff #128304) | Good point, RandomSeed can be zero, but xorshift, as far as i can see, will never turn non-zero to zero. Fixed with a loop in RandomSeed. |