[v3] ntdll: Avoid a case of shift overflow in get_cpuinfo.
Gerald Pfeifer
gerald at pfeifer.com
Mon Oct 26 17:00:14 CDT 2015
After
commit e01dbac2bb4efcd3e93590f9b107cca38623713f
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Oct 26 17:57:50 2015 +0900
ntdll: Remove some redundant shifts.
the other part of my patch is not neccesary/applicable any longer;
this hunk still is, though.
Signed-off-by: Gerald Pfeifer <gerald at pfeifer.com>
---
dlls/ntdll/nt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index 0bcc8b0..edfd0c7 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -1002,7 +1002,7 @@ static inline void get_cpuinfo(SYSTEM_CPU_INFORMATION* info)
user_shared_data->ProcessorFeatures[PF_VIRT_FIRMWARE_ENABLED] = (regs2[2] >> 2) & 1;
user_shared_data->ProcessorFeatures[PF_NX_ENABLED] = (regs2[3] >> 20) & 1;
user_shared_data->ProcessorFeatures[PF_3DNOW_INSTRUCTIONS_AVAILABLE] = (regs2[3] >> 31) & 1;
- if(regs2[3] & (1 << 31)) info->FeatureSet |= CPU_FEATURE_3DNOW;
+ if(regs2[3] & (1u << 31)) info->FeatureSet |= CPU_FEATURE_3DNOW;
}
}
else if (regs[1] == GENU && regs[3] == INEI && regs[2] == NTEL)
--
2.6.2
More information about the wine-patches
mailing list