summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--arm64/abi.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/arm64/abi.c b/arm64/abi.c
index 6ed393d..b6b4612 100644
--- a/arm64/abi.c
+++ b/arm64/abi.c
@@ -100,6 +100,9 @@ typclass(Class *c, Typ *t, int *gp, int *fp)
 		 * memory */
 		c->class |= Cptr;
 		c->size = 8;
+		c->ngp = 1;
+		*c->reg = *gp;
+		*c->cls = Kl;
 		return;
 	}
 
@@ -230,14 +233,7 @@ argsclass(Ins *i0, Ins *i1, Class *carg, Ref *env)
 		case Oparc:
 		case Oargc:
 			typclass(c, &typ[i->arg[0].val], gp, fp);
-			if (c->class & Cptr) {
-				if (ngp > 0) {
-					ngp--;
-					*c->reg = *gp++;
-					*c->cls = Kl;
-					break;
-				}
-			} else if (c->ngp <= ngp) {
+			if (c->ngp <= ngp) {
 				if (c->nfp <= nfp) {
 					ngp -= c->ngp;
 					nfp -= c->nfp;