# wasm: un-regress \`loop\` and \`switch_br\` · gitcafe/zig

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

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

Visibility: public

Requested revision: cb68c0917ab6ef858a7a9a3ed9e85672304f7ab2

Requested commit: cb68c0917ab6ef858a7a9a3ed9e85672304f7ab2

Commit: cb68c0917ab6ef858a7a9a3ed9e85672304f7ab2

Tree: 331d83110d74e2a99ba3195b745c21be13e34ad7

Author: mlugg

Committer: mlugg

## Message

```
wasm: un-regress `loop` and `switch_br`

`.loop` is also a block, so the block_depth must be stored *after* block
creation, ensuring a correct block_depth to jump back to when receiving
`.repeat`.

This also un-regresses `switch_br` which now correctly handles ranges
within cases. It supports it for both jump tables as well as regular
conditional branches.

```

## Parents

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

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