commit 167d22e3038f3166a1aead5a51df3cba4907264f
parent 8192c49f71d7bbc0f4efdc2ef7b63b4d3740a0f6
Author: Drew DeVault <sir@cmpwn.com>
Date: Mon, 4 Oct 2021 13:04:55 +0000
riscv64: fix match syntax
Diffstat:
2 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/rt/+linux/+riscv64.ha b/rt/+linux/+riscv64.ha
@@ -7,17 +7,19 @@ export fn clone(
child_tid: nullable *int,
tls: u64,
) (int | void | errno) = {
- return match (wrap_return(syscall5(SYS_clone,
- flags: u64,
- stack: uintptr: u64,
- parent_tid: uintptr: u64,
- tls,
- child_tid: uintptr: u64))) {
- u: u64 => switch (u) {
- 0 => void,
- * => u: int,
- },
- err: errno => err,
+ match (wrap_return(syscall5(SYS_clone,
+ flags: u64, stack: uintptr: u64,
+ parent_tid: uintptr: u64,
+ tls, child_tid: uintptr: u64))) {
+ case u: u64 =>
+ switch (u) {
+ case 0 =>
+ return;
+ case =>
+ return u: int;
+ };
+ case err: errno =>
+ return err;
};
};
diff --git a/rt/+riscv64/backtrace.ha b/rt/+riscv64/backtrace.ha
@@ -13,8 +13,10 @@ export fn backtrace() frame = frame {
// Returns the frame above the current frame, if any.
export fn nextframe(sframe: frame) (frame | void) = {
let addr = sframe.addr: *nullable *void;
- return match (*addr) {
- null => void,
- a: *void => frame { addr = a }
+ match (*addr) {
+ case null =>
+ return;
+ case a: *void =>
+ return frame { addr = a };
};
};