# stage2/wasm: implement function calls · gitcafe/zig

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

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

Visibility: public

Requested revision: 6242ae35f37a6e67d9da514fa7a3508843515667

Requested commit: 6242ae35f37a6e67d9da514fa7a3508843515667

Commit: 6242ae35f37a6e67d9da514fa7a3508843515667

Tree: a6c43da4312a4aba2d853908b5f6c1e4cb10bfe2

Author: Isaac Freund

Committer: Isaac Freund

## Message

```
stage2/wasm: implement function calls

During codegen we do not yet know the indexes that will be used for
called functions. Therefore, we store the offset into the in-memory
code where the index is needed with a pointer to the Decl and use this
data to insert the proper indexes while writing the binary in the flush
function.

```

## Parents

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

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