# wasm: reference count locals · gitcafe/zig

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

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

Visibility: public

Requested revision: b17c8c542420e14e24ec397b248dfc101a08421e

Requested commit: b17c8c542420e14e24ec397b248dfc101a08421e

Commit: b17c8c542420e14e24ec397b248dfc101a08421e

Tree: 3821eba40a5555939f2c1131a7f888bb634c1a13

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
wasm: reference count locals

By reference counting the locals, we can ensure that when we free
a local, no local will be reused while it still has references pointing
to it. This prevents misscompilations. The compiler will also panic if
we free a local more than we reference it, introducing extra safety to
ensure they match up.

```

## Parents

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

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