Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Linking and Reloc section format #8

Closed
yurydelendik opened this issue Jul 19, 2018 · 1 comment
Closed

Fix Linking and Reloc section format #8

yurydelendik opened this issue Jul 19, 2018 · 1 comment
Labels
wasmparser Related to the binary format of WebAssembly (wasmparser)

Comments

@yurydelendik
Copy link
Contributor

https://github.com/WebAssembly/tool-conventions/blob/master/Linking.md changed. The reader needs to be updated.

@alexcrichton alexcrichton transferred this issue from bytecodealliance/wasmparser May 20, 2020
fitzgen added a commit to fitzgen/wasm-tools that referenced this issue Oct 21, 2020
Refactor construction of limited length vectors
@alexcrichton alexcrichton added wasmparser Related to the binary format of WebAssembly (wasmparser) and removed binary labels May 16, 2022
dhil added a commit to dhil/wasm-tools that referenced this issue Jul 28, 2022
dhil added a commit to dhil/wasm-tools that referenced this issue Jul 28, 2022
dhil added a commit to dhil/wasm-tools that referenced this issue Jul 28, 2022
dhil added a commit to dhil/wasm-tools that referenced this issue Aug 5, 2022
@alexcrichton
Copy link
Member

Closing in favor of #785 as these have been temporarily removed.

alexcrichton added a commit that referenced this issue Feb 10, 2023
* [WIP] Parse reference types from binary

This identifies reference types' magic numbers and advances the parser.
It parses heap types and assembles them into a type for non-nullable
references. But, it does not actually change the syntax yet so it just
panics. It remains to be implemented for nullable references and the
sugars.

* Add nullable reference types and desugar forms

Untested

* [WIP] Factor RefType out of ValType

This checks for wasmparser, but no tests and no other crates yet

* [func-refs] Fix parser tests, finish ref type parsing

* [func-refs] Support ref types in pretty-printer

* [func-refs] Fix pretty-printer bugs

Missing parenthesis and printing a valtype instead of a heap type for
func.ref

* [func-refs] Add support for validator func.ref

* [func-refs] Add syntax in encoder but not support

* [func-refs] Fix printer giving bad types of indices

* Clean up debugging nonsense

* [func-refs] Implement subtyping

* Implement a binary reader for function references instructions. (#1)

* Change ref.null to take heaptype, not valtype

* Update error message to match tests

* Hack around error message test

* [WIP] [func-refs] Add call_ref static semantics

WIP because untested

* Static semantics for function references (#2)

Further changes to validation need to be made, at least including adding subtyping to more places.

* [func-refs] Add subtyping to elements

* Subtyping relation (#4)

* Refactor the validator for function references (#5)

Co-authored-by: Daniel Hillerström <daniel.hillerstrom@ed.ac.uk>
Co-authored-by: cosine <CosineP@users.noreply.github.com>

* [func-refs] Assume matches V128 V128 = true

It looks to me that the function references spec was forked from
webassembly before vectors were merged, so it has no definitive answer
on V128 subtyping.  It also means we accidentally reverted `select`
to an outdated spec.  I think for now it's reasonable to use common
sense for V128 subtyping, and at some point the proposal is presumably
planned to be rebased?

* [func-refs] Support validate flag, br_table.wast notes

* [func-refs] Bypass inconsistent test message

This is a mismatch from the original spec tests, however in
function-references the same exact test for some reason has a slightly
different message, so the bypass needs another case.

* [func-refs] Require defaultable table types

This is from the specification of defaultability from here:
WebAssembly/function-references#62

That change still doesn't include locals, which are under discussion.
The implementation as of now still requires defaultable locals as in the
test suite.

* [func-refs] Add subtyping to table.copy

* [func-refs] Correct f type structural equivalence

This checks that arguments to a function are themselves structurally
equivalent. Note that this is at least as difficult as a recursive
subtyping relation would be, since we now need to implement
vt1 <= vt2
AND
vt1 == vt2
including for function types, despite the fact that <= is (even stated
to be) preferable in this case

* [func-refs] Perform some cleanup

Move some things into order and fix some doc comments.  This is not
enough cleanup, more needs to be done

* Fix bad brace matching from github commit

* [func-refs] Order operator validation as in spec

* [func-refs] Restore feature check in return_call_ref

* Fix todos in validator/core.rs (#8)

* Add missing brace

* Fix bad merge

* Fix failing test case (#11)

* Implement missing functions in EmptyResources trait in func.rs

* Fix failing test

* [func-refs] Reorder wasmprinter instructions

* [func-refs] Remove incorrect comment; format

* Merge with upstream; simplify the implementation of matches.

* Run cargo fmt

* Fix compile errors with the rest of the workspace

* Leave `unimplemented!()` for `Ref` types other than funcref/externref
* Leave `unreachable!()` for `Bot` cases

* Print old `funcref` and `externref` for those types

Helps improve compatibility with other text parsers and additionally
fixes a few tests which have "golden output" and assert that `funcref`
and `extenref` are printed.

* Fix a doctest example

* Fix indirect_call subtype; small comments

* Fix wasmparser benchmark

* Fixup merge conflicts

* Add type payload to `call_ref` and `return_call_ref`

* Fix a typo

* Fix tests

* Remove ValType::Bot

* Rename `HeapType::Index` to `HeapType::TypedFunc`.

* Enable new working, disable new broken tests

* Pack ValType into 4 bytes

* [func-refs] Implement initialization checking

* Fix printing of element kind

* Update dump

* wip

* wip

* Fix failing `*.wast` tests and align APIs

This commit fixes some decoding of types in the `wasmparser` crate and
then additionally adds support in `wasmparser`, `wasm-encoder`, etc, for
the initialization expression of a table being specified. This involved
aligning the type hierarchy of `wasm-encoder` with that of `wasmparser`
which involved quite a few changes in a number of crates. Overall though
this is mostly syntactic changes without much meat happening here.

* Touch up some docs and style

* Handle some minor TODO comments

* Improve an error message

* Update test exemptions

* Remove redundant branches

* Attempt to fix fuzz/fuzz_targets/validate.rs

* fmt

* Remove `HeapType::Bot` from the public API

Move it as an internal implementation detail of the validator.

---------

Co-authored-by: Luna Phipps-Costin <phipps-costin.l@northeastern.edu>
Co-authored-by: cosine <CosineP@users.noreply.github.com>
Co-authored-by: Alex Crichton <alex@alexcrichton.com>
Co-authored-by: cosine <trash@cosine.online>
dhil added a commit to dhil/wasm-tools that referenced this issue Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasmparser Related to the binary format of WebAssembly (wasmparser)
Projects
None yet
Development

No branches or pull requests

2 participants