# os/plan9: fix order of register setting in syscall1 · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/c842deea757a3de7565b6b06f5e6c0b5cc883827)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: c842deea757a3de7565b6b06f5e6c0b5cc883827

Requested commit: c842deea757a3de7565b6b06f5e6c0b5cc883827

Commit: c842deea757a3de7565b6b06f5e6c0b5cc883827

Tree: c644349a804231edd0b065ba90dbf06d2263cf46

Author: Jacob G-W

Committer: Veikka Tuominen

## Message

```
os/plan9: fix order of register setting in syscall1

We need to set rbp last because the arguments are stored on the
stack. If we clobber rbp first, then we will get a segfault when
trying to access the function arguments.

I believe I had already done this with the other syscall* functions,
but not with syscall1, so this allows single argument syscalls like
close to work.

```

## Parents

- [34d44e0c1c2cdfc5916dd5c56914f181f87e8d85](https://git.cafe/gitcafe/zig/commit/34d44e0c1c2cdfc5916dd5c56914f181f87e8d85?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/c842deea757a3de7565b6b06f5e6c0b5cc883827?format=markdown)
