shithub: mc

Download patch

ref: 9168c60d542e2ee877a7d9ccfaf88593b936bd3f
parent: ac9b5e75f6c6cd0171b0b86b9b109cc1d9639d5c
author: Ori Bernstein <[email protected]>
date: Fri Dec 26 19:31:42 EST 2014

More tests pass.

--- a/libstd/util+plan9-x64.s
+++ b/libstd/util+plan9-x64.s
@@ -11,7 +11,7 @@
 TEXT sys$cstring+0(SB),$0
 	/* save registers */
 	MOVQ	SP,BP
-	SUBQ	$48,SP
+	SUBQ	$40,SP
 	MOVQ	BP,-8(BP)
 	MOVQ	R15,-16(BP)
 	MOVQ	SI,-24(BP)
@@ -26,7 +26,7 @@
 	SUBQ	$1,SP		/* +1 for nul */
 	MOVQ	SP,DI		/* dest */
 	MOVQ	SP,AX		/* ret val */
-	SUBQ	$31,SP		/* "unpop" the args */
+	SUBQ	$24,SP		/* "unpop" the args and make room for return addr */
 	ANDQ	$(~15),SP	/* align */
 
 	CLD
@@ -57,7 +57,7 @@
 	/* get stack space */
 	SUBQ	BX,SP		/* get stack space */
 	MOVQ	SP,AX		/* top of stack (return value) */
-	SUBQ	$3,SP		/* "unpop" the args for return */
+	SUBQ	$24,SP		/* "unpop" the args for return, and reserve ret addr */
 	ANDQ	$(~15),SP	/* align */
 
 	MOVQ	R15,0(SP)	/* place ret addr */
--- a/test/runtest.rc
+++ b/test/runtest.rc
@@ -6,7 +6,7 @@
 nfailed=0
 
 fn build {
-	rm -f $1 $1^.6 $1^.s $1^.use
+	rm -f $1 $1^.6 $1^.use
 	../myrbuild/6.out -b $1 -C../6/6.out -M../muse/6.out -I../libstd -r../rt/_myrrt.6 $1^.myr
 }