# wasm: Implement \`array_to_slice\` and bug fixes: · gitcafe/zig

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

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

Visibility: public

Requested revision: f644c8b0478126484ce2780eb98336c2b4ff0177

Requested commit: f644c8b0478126484ce2780eb98336c2b4ff0177

Commit: f644c8b0478126484ce2780eb98336c2b4ff0177

Tree: 3253184b67a641f8d72d306280c0f3876ce9ff2a

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
wasm: Implement `array_to_slice` and bug fixes:

- Add method to easily create local for virtual stack
- Ensure function pointers are passed correctly
- Correctly handle slices as return types and values
- Fix wrapping error sets/payloads.
- Handle ptr-like optionals correctly, by using address '0' as null.
- Implement `array_to_slice`
- linker: Always emit a table, so call_indirect inside bodies do not fail if there's no table.
TODO: Only do this when we emit a call_indirect but the relocation cannot be resolved.

```

## Parents

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

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