diff --git a/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp b/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp index 68506680eed0909fecef1f86eb04972798a56ad8..e432854b3dea5864f16e408eb23d4393c8e53cf5 100644 --- a/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp +++ b/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp @@ -414,6 +414,9 @@ void GuardedPoolAllocator::freeSlot(size_t SlotIndex) { uint32_t GuardedPoolAllocator::getRandomUnsigned32() { uint32_t RandomState = getThreadLocals()->RandomState; + if (RandomState == 0) { + RandomState = 0xacd979ce; + } RandomState ^= RandomState << 13; RandomState ^= RandomState >> 17; RandomState ^= RandomState << 5;