# wasm/Object: parse using the correct file size · gitcafe/zig

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

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

Visibility: public

Requested revision: 1544625df3fb4732f2cd63d1e7c4c738d1b7d0c0

Requested commit: 1544625df3fb4732f2cd63d1e7c4c738d1b7d0c0

Commit: 1544625df3fb4732f2cd63d1e7c4c738d1b7d0c0

Tree: 9daf0a93df0113b19f2f0747ca7a645b2123feec

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
wasm/Object: parse using the correct file size

When an object file is being parsed from within an archive
file, we provide the object file size to ensure we do not
read past the object file. This is because follow up object
files can exist there, as well as an LF character to notate
the end of the file was reached. Such a character is invalid
within the object file.

This also fixes a bug in getting the function/global type
for defined globals/functions from object files as it was missing
the substraction with the import count of the respective type.

```

## Parents

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

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