Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/google/cpu_features.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Chatelet <gchatelet@google.com>2019-11-13 16:39:06 +0300
committerGuillaume Chatelet <gchatelet@google.com>2019-11-13 16:39:06 +0300
commit8a6fd87074759bc396e2bec66eded194ab63c2f1 (patch)
treecd6ef8e8e9e42e4c665e8041185eb86d81a74775
parent77092c6d9640eae46c9dd5827ae8e5ab36dfa0d9 (diff)
[NFC] Fixed signed shift
signed shift result (0x80000000) sets the sign bit of the shift expression's type ('int') and becomes negative
-rw-r--r--src/cpuinfo_x86.c2
1 files changed, 1 insertions, 1 deletions
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];