# wasm: fix miscompilation for shifting · gitcafe/zig

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

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

Visibility: public

Requested revision: e20976b7f209a768cb55a37e6a58ed177d76013e

Requested commit: e20976b7f209a768cb55a37e6a58ed177d76013e

Commit: e20976b7f209a768cb55a37e6a58ed177d76013e

Tree: 53a20b15a36ac7423d2e36a1f743b8b44c0243b6

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
wasm: fix miscompilation for shifting

This fix ensures that when we are shifting left or right,
both operands have the same WebAssembly type. e.g. it's not possible
to shift a 64 bit integer and 32 bit integer together and will fail
WebAssembly's validator. By first coercing the values to the same
type, we ensure we satisfy the validator.

```

## Parents

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

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