# AstGen: do not forward result pointers through @as · gitcafe/zig

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

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

Visibility: public

Requested revision: cba7e8a4e95aa2a2031d0fbaa8247de37e61fd78

Requested commit: cba7e8a4e95aa2a2031d0fbaa8247de37e61fd78

Commit: cba7e8a4e95aa2a2031d0fbaa8247de37e61fd78

Tree: f6e7c7139d90aa41ace1498475d6a56f4c40956f

Author: mlugg

Committer: Andrew Kelley

## Message

```
AstGen: do not forward result pointers through @as

The `coerce_result_ptr` instruction is highly problematic and leads to
unintentional memory reinterpretation in some cases. It is more correct
to simply not forward result pointers through this builtin.

`coerce_result_ptr` is still used for struct and array initializations,
where it can still cause issues. Eliminating this usage will be a future
change.

Resolves: #16991

```

## Parents

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

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