@@ -5477,15 +5477,15 @@ struct VM {
54775477 // std::random_device{}() uses RDRAND/RDSEED which can be intercepted by hypervisors
54785478 // we use our own compile-time seed that cannot be taken by examining PE/Linux binary properties and would need static/dynamic analysis
54795479 // this changes per build and per process session due to hardware ASLR
5480- std::uintptr_t seed = 0;
5481- seed ^= static_cast<std::uintptr_t >(ct_seed);
5482- seed ^= reinterpret_cast<std::uintptr_t>(¤t_process);
5483- seed ^= reinterpret_cast<std::uintptr_t>(&procMask) << 1;
5484- seed ^= reinterpret_cast<std::uintptr_t>(&sysMask) << 2;
5485- seed ^= reinterpret_cast<std::uintptr_t>(&len) << 3;
5486- seed ^= reinterpret_cast<std::uintptr_t>(&stackBuf[0]) << 4;
5487- seed ^= reinterpret_cast<std::uintptr_t>(&heapBuf) << 5;
5488- seed ^= reinterpret_cast<std::uintptr_t>(&buf) << 6;
5480+ std::uint64_t seed = 0;
5481+ seed ^= static_cast<u64 >(ct_seed);
5482+ seed ^= static_cast<u64>( reinterpret_cast<std::uintptr_t>(¤t_process) );
5483+ seed ^= static_cast<u64>( reinterpret_cast<std::uintptr_t>(&procMask) ) << 1;
5484+ seed ^= static_cast<u64>( reinterpret_cast<std::uintptr_t>(&sysMask) ) << 2;
5485+ seed ^= static_cast<u64>( reinterpret_cast<std::uintptr_t>(&len) ) << 3;
5486+ seed ^= static_cast<u64>( reinterpret_cast<std::uintptr_t>(&stackBuf[0]) ) << 4;
5487+ seed ^= static_cast<u64>( reinterpret_cast<std::uintptr_t>(&heapBuf) ) << 5;
5488+ seed ^= static_cast<u64>( reinterpret_cast<std::uintptr_t>(&buf) ) << 6;
54895489
54905490 seed ^= seed >> 33;
54915491 seed *= 0xff51afd7ed558ccdULL;
@@ -5711,17 +5711,17 @@ struct VM {
57115711
57125712 // so that hypervisor can't predict how many samples we will collect
57135713 // stack-only / ASLR-derived component (no APIs, no rdtsc)
5714- std::uintptr_t seed = 0;
5715- seed ^= static_cast<std::uintptr_t >(ct_seed);
5714+ std::uint64_t seed = 0;
5715+ seed ^= static_cast<std::uint64_t >(ct_seed);
57165716
57175717 std::uint64_t local1 = 0;
57185718 std::uint64_t local2 = 0;
57195719 std::uint64_t local3 = 0;
57205720
5721- seed ^= reinterpret_cast<std::uintptr_t>(&seed);
5722- seed ^= reinterpret_cast<std::uintptr_t>(&local1) << 1;
5723- seed ^= reinterpret_cast<std::uintptr_t>(&local2) << 2;
5724- seed ^= reinterpret_cast<std::uintptr_t>(&local3) << 3;
5721+ seed ^= static_cast<u64>( reinterpret_cast<std::uintptr_t>(&seed) );
5722+ seed ^= static_cast<u64>( reinterpret_cast<std::uintptr_t>(&local1) ) << 1;
5723+ seed ^= static_cast<u64>( reinterpret_cast<std::uintptr_t>(&local2) ) << 2;
5724+ seed ^= static_cast<u64>( reinterpret_cast<std::uintptr_t>(&local3) ) << 3;
57255725
57265726 // splitmix64
57275727 seed ^= seed >> 33;
0 commit comments