# x64: spill \.rdi to stack if expecting return value saved on stack · gitcafe/zig

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

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

Visibility: public

Requested revision: 376d0878ec2e366633e2dbc7c91ab7ae2a6ae5b7

Requested commit: 376d0878ec2e366633e2dbc7c91ab7ae2a6ae5b7

Commit: 376d0878ec2e366633e2dbc7c91ab7ae2a6ae5b7

Tree: d3c55c3acdd58283c85057cf7f351925f5e8969f

Author: Jakub Konka

Committer: Jakub Konka

## Message

```
x64: spill .rdi to stack if expecting return value saved on stack

Since .rdi is not part of the callee saved registers, it needs to be
proactively spilled to the stack so that we don't clobber the
return address where to save the return value.

```

## Parents

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

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