Skip to contentSkip to conversation

fix undefined shifts by >32

PATCH In review Paolo Bonzini 2 participants 2 messages Jan 28, 2010 – Feb 27, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix undefined shifts by >32

---
 vl.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
vl.c +2 -2
index 5e8c775..d9f1ccb 100644
@@ -2373,9 +2373,9 @@ static void numa_add(const char *optarg)
                         fprintf(stderr,
                             "only 63 CPUs in NUMA mode supported.\n");
                     }
-                    value = (1 << (endvalue + 1)) - (1 << value);
+                    value = (2ULL << endvalue) - (1ULL << value);
                 } else {
-                    value = 1 << value;
+                    value = 1ULL << value;
                 }
             }
             node_cpumask[nodenr] = value;
Signature · 1 line
1.6.6
#1 lore raw

I have actually cherry-picked the commit from HEAD.

Quoted 28 lines · Paolo Bonzini
---
 vl.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
vl.c +2 -2
index 5e8c775..d9f1ccb 100644
@@ -2373,9 +2373,9 @@ static void numa_add(const char *optarg)
                         fprintf(stderr,
                             "only 63 CPUs in NUMA mode supported.\n");
                     }
-                    value = (1 << (endvalue + 1)) - (1 << value);
+                    value = (2ULL << endvalue) - (1ULL << value);
                 } else {
-                    value = 1 << value;
+                    value = 1ULL << value;
                 }
             }
             node_cpumask[nodenr] = value;
Signature · 1 line
1.6.6
Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net