Patchwork [v2,RESEND,2/5] fix undefined shifts by >32

login
register
mail settings
Submitter Paolo Bonzini
Date Feb. 4, 2010, 1:31 p.m.
Message ID <1265290313-31738-3-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/44483/
State New
Headers show

Comments

Paolo Bonzini - Feb. 4, 2010, 1:31 p.m.
This one is for 0.12 too.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 vl.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Paolo Bonzini - Feb. 25, 2010, 2:02 p.m.
On 02/04/2010 02:31 PM, Paolo Bonzini wrote:
> This one is for 0.12 too.
>
> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
> ---
>   vl.c |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index 39833fc..ea9a95c 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -2380,9 +2380,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;

Ping for 0.12 (commit 0dfbd51).

Paolo

Patch

diff --git a/vl.c b/vl.c
index 39833fc..ea9a95c 100644
--- a/vl.c
+++ b/vl.c
@@ -2380,9 +2380,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;