mirror of
https://github.com/google/cpu_features.git
synced 2025-07-01 13:21:13 +02:00
[NFC] Fixed signed shift
signed shift result (0x80000000) sets the sign bit of the shift expression's type ('int') and becomes negative
This commit is contained in:
@ -484,7 +484,7 @@ static void ParseLeaf2(const int max_cpuid_leaf, CacheInfo* info) {
|
||||
Leaf leaf = SafeCpuId(max_cpuid_leaf, 2);
|
||||
uint32_t registers[] = {leaf.eax, leaf.ebx, leaf.ecx, leaf.edx};
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
if (registers[i] & (1 << 31)) {
|
||||
if (registers[i] & (1U << 31)) {
|
||||
continue; // register does not contains valid information
|
||||
}
|
||||
uint32_t bytes[4];
|
||||
|
Reference in New Issue
Block a user