ensure regs is initialized even if cpuid fails

This commit is contained in:
Graydon Hoare 2020-06-03 11:11:15 -07:00
parent 9e500bc897
commit 93b7b5a8e7
No known key found for this signature in database
GPG Key ID: 69824B014EE65219

View File

@ -173,6 +173,7 @@ struct ThreadHandleWrapper
#if defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64
static inline void CpuId( uint32_t* regs, uint32_t leaf )
{
memset(regs, 0, sizeof(uint32_t) * 4);
#if defined _WIN32 || defined __CYGWIN__
__cpuidex( (int*)regs, leaf, 0 );
#else