Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm Can't rely on side-effects in KASSERT expressions wh...



details:   https://anonhg.NetBSD.org/src/rev/f6f6a405bbaa
branches:  trunk
changeset: 551208:f6f6a405bbaa
user:      pk <pk%NetBSD.org@localhost>
date:      Mon Sep 01 14:20:57 2003 +0000

description:
Can't rely on side-effects in KASSERT expressions which was pointed out to
me by YAMAMOTO Takashi.

diffstat:

 sys/uvm/uvm_pager.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (32 lines):

diff -r e2997d4b862e -r f6f6a405bbaa sys/uvm/uvm_pager.c
--- a/sys/uvm/uvm_pager.c       Mon Sep 01 12:28:03 2003 +0000
+++ b/sys/uvm/uvm_pager.c       Mon Sep 01 14:20:57 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_pager.c,v 1.61 2003/08/28 13:12:19 pk Exp $        */
+/*     $NetBSD: uvm_pager.c,v 1.62 2003/09/01 14:20:57 pk Exp $        */
 
 /*
  *
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_pager.c,v 1.61 2003/08/28 13:12:19 pk Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pager.c,v 1.62 2003/09/01 14:20:57 pk Exp $");
 
 #include "opt_uvmhist.h"
 
@@ -380,9 +380,10 @@
 
                        if (swap) {
                                if (pg->uobject != NULL) {
-                                       KASSERT(uao_set_swslot(pg->uobject,
-                                               pg->offset >> PAGE_SHIFT,
-                                               slot) == swslot + i);
+                                       int oldslot;
+                                       oldslot = uao_set_swslot(pg->uobject,
+                                               pg->offset >> PAGE_SHIFT, slot);
+                                       KASSERT(oldslot == swslot + i);
                                } else {
                                        KASSERT(pg->uanon->an_swslot ==
                                                swslot + i);



Home | Main Index | Thread Index | Old Index