Bug 1742472 - fix the clang implementation of has_cpuid_bits for the levels in the 0x80000000 range, r=jrmuizel.

Differential Revision: https://phabricator.services.mozilla.com/D131946
This commit is contained in:
Florian Queze 2021-11-24 10:46:44 +00:00
parent 7be3218970
commit a2e85fcc9f

View File

@ -30,7 +30,7 @@ static bool has_cpuid_bits(unsigned int level, CPUIDRegister reg,
unsigned int bits) {
unsigned int regs[4];
unsigned int eax, ebx, ecx, edx;
unsigned max = __get_cpuid_max(0, NULL);
unsigned max = __get_cpuid_max(level & 0x80000000u, nullptr);
if (level > max) return false;
__cpuid_count(level, 0, eax, ebx, ecx, edx);
regs[0] = eax;