# spirv: fix use-after-realloc in resolveType\(\) · gitcafe/zig

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

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

Visibility: public

Requested revision: 5d896a6cc6b7127dd4db0bd386ebe33da82d7824

Requested commit: 5d896a6cc6b7127dd4db0bd386ebe33da82d7824

Commit: 5d896a6cc6b7127dd4db0bd386ebe33da82d7824

Tree: 5644af71416f1bd3a5242d1e645bd2ca4c80ad00

Author: Robin Voetter

Committer: Robin Voetter

## Message

```
spirv: fix use-after-realloc in resolveType()

The pointer to a slot in a hash map was fetched before a recursive call.
If the hash map's size changed during the recursive call, this would write
to an invalid pointer.

The solution is to use an index instead of a pointer. Note that care must be
taken that resolved types (from the type_cahce) must not be accessed, as they
might be incomplete during this operation.

```

## Parents

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

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