Patchwork [2/6] fix undefined shifts by >32

login
register
mail settings
Submitter Paolo Bonzini
Date Jan. 27, 2010, 1:54 p.m.
Message ID <1264600499-3384-3-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/43803/
State New
Headers show

Comments

Paolo Bonzini - Jan. 27, 2010, 1:54 p.m.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 vl.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/vl.c b/vl.c
index 5e8c775..d9f1ccb 100644
--- a/vl.c
+++ b/vl.c
@@ -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;