From 453ca8db4337f4f59c3c5b4356d5f70aa9b32260 Mon Sep 17 00:00:00 2001 From: ftrvxmtrx Date: Sat, 13 Jun 2015 20:21:26 +0200 Subject: [PATCH] qc, 9/ppc, 9/mtx: fix wrong if statements --- sys/src/9/mtx/trap.c | 4 ++-- sys/src/9/ppc/trap.c | 4 ++-- sys/src/cmd/qc/txt.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/src/9/mtx/trap.c b/sys/src/9/mtx/trap.c index f3e9f2e46..d9f827216 100644 --- a/sys/src/9/mtx/trap.c +++ b/sys/src/9/mtx/trap.c @@ -220,7 +220,7 @@ trap(Ureg *ureg) if(user) up->dbgreg = ureg; - if(ureg->status & MSR_RI == 0) + if((ureg->status & MSR_RI) == 0) print("double fault?: ecode = %d\n", ecode); switch(ecode) { @@ -490,7 +490,7 @@ dumpregs(Ureg *ur) if(up) { print("registers for %s %ld\n", up->text, up->pid); - if(ur->srr1 & MSR_PR == 0) + if((ur->srr1 & MSR_PR) == 0) if(ur->usp < (ulong)up->kstack || ur->usp > (ulong)up->kstack+KSTACK) print("invalid stack ptr\n"); } diff --git a/sys/src/9/ppc/trap.c b/sys/src/9/ppc/trap.c index 64decfae2..c7a5dac4f 100644 --- a/sys/src/9/ppc/trap.c +++ b/sys/src/9/ppc/trap.c @@ -167,7 +167,7 @@ trap(Ureg *ureg) cycles(&up->kentry); up->dbgreg = ureg; } - if(ureg->status & MSR_RI == 0) + if((ureg->status & MSR_RI) == 0) print("double fault?: ecode = %d\n", ecode); switch(ecode) { @@ -480,7 +480,7 @@ dumpregs(Ureg *ur) if(up) { print("registers for %s %ld\n", up->text, up->pid); - if(ur->srr1 & MSR_PR == 0) + if((ur->srr1 & MSR_PR) == 0) if(ur->usp < (ulong)up->kstack || ur->usp > (ulong)up->kstack+KSTACK) print("invalid stack ptr\n"); } diff --git a/sys/src/cmd/qc/txt.c b/sys/src/cmd/qc/txt.c index e5f96fb42..601c047b6 100644 --- a/sys/src/cmd/qc/txt.c +++ b/sys/src/cmd/qc/txt.c @@ -1522,7 +1522,7 @@ gopcode64(int o, Node *f1, Node *f2, Node *t) if(a1 == AGOK || a2 == AGOK) diag(Z, "bad in gopcode64 %O", o); if(f1->op == OCONST) { - if(f2 != Z & f2 != t) + if(f2 != Z && f2 != t) diag(Z, "bad const in gopcode64 %O", o); gins(a1, nod32const(f1->vconst), t->right); gins(a2, nod32const(f1->vconst>>32), t->left);