# wasm: correctly get the type of a local for free · gitcafe/zig

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

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

Visibility: public

Requested revision: 6fcd72355cac1495c213da20a6cf4f6f30bd2a65

Requested commit: 6fcd72355cac1495c213da20a6cf4f6f30bd2a65

Commit: 6fcd72355cac1495c213da20a6cf4f6f30bd2a65

Tree: 227d979fb5516aadc3225b692666123a1998d3fa

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
wasm: correctly get the type of a local for free

When determining the type of a local (read: register), we would
previously subtract the stack locals also. However, this locals
are also within the same `locals` list, meaning the type of the
local we were retrieving was off by 2. This could create a validation
error when we re-use a local of a different type.

```

## Parents

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

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