From 8a6fd87074759bc396e2bec66eded194ab63c2f1 Mon Sep 17 00:00:00 2001 From: Guillaume Chatelet Date: Wed, 13 Nov 2019 14:39:06 +0100 Subject: [PATCH] [NFC] Fixed signed shift signed shift result (0x80000000) sets the sign bit of the shift expression's type ('int') and becomes negative --- src/cpuinfo_x86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpuinfo_x86.c b/src/cpuinfo_x86.c index ea29ca0..149ec40 100644 --- a/src/cpuinfo_x86.c +++ b/src/cpuinfo_x86.c @@ -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];