shithub: riscv

Download patch

ref: dae5a44111dfb21a714824a5cec2abee4f9f9080
parent: c69bf6e0bc573a72c2e9f03155daa2f47e357436
author: aiju <devnull@localhost>
date: Thu Dec 13 05:38:21 EST 2018

pc(1): reference counting bug

--- a/sys/src/cmd/pc.y
+++ b/sys/src/cmd/pc.y
@@ -825,6 +825,7 @@
 		numdecref(a[1]);
 		return nil;
 	}
+	a[0] = nummod(a[0]);
 	mptrunc(a[0], i, a[0]);
 	return a[0];
 }
@@ -835,6 +836,7 @@
 	int i;
 	
 	if(toint(a[1], &i, 1)) return nil;
+	a[0] = nummod(a[0]);
 	mpxtend(a[0], i, a[0]);
 	return a[0];
 }