Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc64/sparc64 Left-shift of negative values is UB.



details:   https://anonhg.NetBSD.org/src/rev/1f083aee90ab
branches:  trunk
changeset: 812026:1f083aee90ab
user:      joerg <joerg%NetBSD.org@localhost>
date:      Fri Nov 27 13:51:24 2015 +0000

description:
Left-shift of negative values is UB.

diffstat:

 sys/arch/sparc64/sparc64/pmap.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 3def32fa517b -r 1f083aee90ab sys/arch/sparc64/sparc64/pmap.c
--- a/sys/arch/sparc64/sparc64/pmap.c   Fri Nov 27 13:45:17 2015 +0000
+++ b/sys/arch/sparc64/sparc64/pmap.c   Fri Nov 27 13:51:24 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.299 2015/09/08 13:18:06 nakayama Exp $      */
+/*     $NetBSD: pmap.c,v 1.300 2015/11/27 13:51:24 joerg Exp $ */
 /*
  *
  * Copyright (C) 1996-1999 Eduardo Horvath.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.299 2015/09/08 13:18:06 nakayama Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.300 2015/11/27 13:51:24 joerg Exp $");
 
 #undef NO_VCACHE /* Don't forget the locked TLB in dostart */
 #define        HWREF
@@ -1418,7 +1418,7 @@
        }
        DPRINTF(PDB_GROW, ("pmap_growkernel(%lx...%lx)\n", kbreak, maxkvaddr));
        /* Align with the start of a page table */
-       for (kbreak &= (-1 << PDSHIFT); kbreak < maxkvaddr;
+       for (kbreak &= ((~0ULL) << PDSHIFT); kbreak < maxkvaddr;
             kbreak += (1 << PDSHIFT)) {
                if (pseg_get(pm, kbreak) & TLB_V)
                        continue;



Home | Main Index | Thread Index | Old Index