# Sema: fix ret_ptr when inlining · gitcafe/zig

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

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

Visibility: public

Requested revision: 79702c144d713de126d37637630c7b25ee9ecc82

Requested commit: 79702c144d713de126d37637630c7b25ee9ecc82

Commit: 79702c144d713de126d37637630c7b25ee9ecc82

Tree: 71a39e1be451f8265ab12cdca56c67e924711208

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
Sema: fix ret_ptr when inlining

Previously, it would emit a ret_ptr AIR instruction but that is not
correct because such an instruction would reference the result pointer
of the caller function rather than the callee function.

Instead, we emit an alloc instruction in this case. `ret_load` already
handles inlining correctly.

```

## Parents

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

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