mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
target-i386: Use 1UL for bit shift
Fix undefined behavior detected by clang runtime check: qemu/target-i386/cpu.c:1494:15: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' While doing that, add extra parenthesis for clarity. Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
b6c5a6f021
commit
72370dc114
1 changed files with 1 additions and 1 deletions
|
@ -1491,7 +1491,7 @@ static void report_unavailable_features(FeatureWord w, uint32_t mask)
|
|||
int i;
|
||||
|
||||
for (i = 0; i < 32; ++i) {
|
||||
if (1 << i & mask) {
|
||||
if ((1UL << i) & mask) {
|
||||
const char *reg = get_register_name_32(f->cpuid_reg);
|
||||
assert(reg);
|
||||
fprintf(stderr, "warning: %s doesn't support requested feature: "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue