1
0
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:
Guillaume Chatelet
2019-11-13 14:39:06 +01:00
parent 77092c6d96
commit 8a6fd87074

View File

@ -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];