# stage2-wasm: finishAir handle \.stack result · gitcafe/zig

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

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

Visibility: public

Requested revision: 31706dc31acdc875899ca18cf92a2fccb3a2f0c7

Requested commit: 31706dc31acdc875899ca18cf92a2fccb3a2f0c7

Commit: 31706dc31acdc875899ca18cf92a2fccb3a2f0c7

Tree: 6ef1e3268f32dded4c1af4c356a370986842a3f0

Author: Pavel Verigo

Committer: Pavel Verigo

## Message

```
stage2-wasm: finishAir handle .stack result

By allowing finishAir to handle .stack results, we simplify a lot of code in
air*** functions, which try to handle this case. Also this changes will result in optimization, if one of operands is dead after instruction its place could be reused by result.

The only downside to this change is that finishAir now can return error, though it handled by returning finishAir result, because it always needs to be final in air*** functions.

Additionally I migrated WValue{ to .{ inside CodeGen.zig.

```

## Parents

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

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