summary refs log tree commit diff
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin@c9x.me>2023-05-09 12:39:51 +0200
committerQuentin Carbonneaux <quentin@c9x.me>2023-05-09 12:39:51 +0200
commit50452b88e98488875c11995902e9212ddd0f8414 (patch)
tree226a5dbecc587bb4173eb67e0d11e9bf83725e93
parent96f16f958a7f8a5be0e68e22cabc97650b894728 (diff)
downloadroux-50452b88e98488875c11995902e9212ddd0f8414.tar.gz
fix sub-word returns on arm64_apple
-rw-r--r--arm64/abi.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arm64/abi.c b/arm64/abi.c
index 65b4bab..abc02d9 100644
--- a/arm64/abi.c
+++ b/arm64/abi.c
@@ -800,8 +800,8 @@ arm64_abi(Fn *fn)
 }
 
 /* abi0 for apple target; introduces
- * necessery sign extension for arg
- * passing & returns
+ * necessary sign extensions in calls
+ * and returns
  */
 void
 apple_extsb(Fn *fn)
@@ -819,6 +819,7 @@ apple_extsb(Fn *fn)
 			op = Oextsb + (j - Jretsb);
 			emit(op, Kw, r, b->jmp.arg, R);
 			b->jmp.arg = r;
+			b->jmp.type = Jretw;
 		}
 		for (i=&b->ins[b->nins]; i>b->ins;) {
 			emiti(*--i);
@@ -845,7 +846,7 @@ apple_extsb(Fn *fn)
 	}
 
 	if (debug['A']) {
-		fprintf(stderr, "\n> After apple_extsb:\n");
+		fprintf(stderr, "\n> After Apple pre-ABI:\n");
 		printfn(fn, stderr);
 	}
 }