# InternPool: prevent anon struct UAF bugs with type safety · gitcafe/zig

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

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

Visibility: public

Requested revision: cb6201715a7bcae2b278811186afc17a697b25f7

Requested commit: cb6201715a7bcae2b278811186afc17a697b25f7

Commit: cb6201715a7bcae2b278811186afc17a697b25f7

Tree: 30db7b0844d0769b87664e83164f734fae1a9627

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
InternPool: prevent anon struct UAF bugs with type safety

Instead of using actual slices for InternPool.Key.AnonStructType, this
commit changes to use Slice types instead, which store a
long-lived index rather than a pointer.

This is a follow-up to 7ef1eb1c27754cb0349fdc10db1f02ff2dddd99b.

```

## Parents

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

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