shithub: riscv

Download patch

ref: 453ca8db4337f4f59c3c5b4356d5f70aa9b32260
parent: d6eb7cc71c89762694fad552aa21489c55bf0a29
author: ftrvxmtrx <[email protected]>
date: Sat Jun 13 16:21:26 EDT 2015

qc, 9/ppc, 9/mtx: fix wrong if statements

--- a/sys/src/9/mtx/trap.c
+++ b/sys/src/9/mtx/trap.c
@@ -220,7 +220,7 @@
 	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 @@
 
 	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");
 	}
--- a/sys/src/9/ppc/trap.c
+++ b/sys/src/9/ppc/trap.c
@@ -167,7 +167,7 @@
 		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 @@
 
 	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");
 	}
--- a/sys/src/cmd/qc/txt.c
+++ b/sys/src/cmd/qc/txt.c
@@ -1522,7 +1522,7 @@
 	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);