Skip to content

Validate features when building shared types#8298

Merged
tlively merged 2 commits intomainfrom
validate-shared-types
Feb 11, 2026
Merged

Validate features when building shared types#8298
tlively merged 2 commits intomainfrom
validate-shared-types

Conversation

@tlively
Copy link
Member

@tlively tlively commented Feb 11, 2026

Previously we would validate that some usages (e.g. globals) of shared
types required the shared-everything feature, but that was not enough
to prevent fuzzer issues because it was still possible to write a file
that used shared types and passed validation without shared-everything,
so would fail when fuzzed on V8. Fix the problem by validating features
when building shared types in the first place.

Previously we would validate that some usages (e.g. globals) of shared
types required the shared-everything feature, but that was not enough
to prevent fuzzer issues because it was still possible to write a file
that used shared types and passed validation without shared-everything,
so would fail when fuzzed on V8. Fix the problem by validating features
when building shared types in the first place.
@tlively tlively requested a review from kripken February 11, 2026 18:31
@tlively tlively enabled auto-merge (squash) February 11, 2026 18:57
@tlively tlively merged commit 4f9f76e into main Feb 11, 2026
17 checks passed
@tlively tlively deleted the validate-shared-types branch February 11, 2026 19:42
@kripken
Copy link
Member

kripken commented Feb 11, 2026

This does not seem to have fixed the issue mentioned in

#8267 (comment)

$ bin/wasm-opt lit/passes/gto-shared-jsinterop.wast -all --disable-shared-everything
warning: no passes specified, not doing any work
warning: no output file specified, not emitting output

$ cat lit/passes/gto-shared-jsinterop.wast | grep shared
    ;; Maybe we will support shared prototypes someday. The shared externref
    ;; CHECK:       (type $desc (describes $struct) (struct (field (ref null (shared extern)))))
    (type $desc (describes $struct) (struct (field (ref null (shared extern)))))

The file parses without shared-everything, but it uses shared.

@tlively
Copy link
Member Author

tlively commented Feb 11, 2026

Oh, right, sorry, because that's using a shared abstract heap type...

tlively added a commit that referenced this pull request Feb 11, 2026
We started validating that shared-everything is enabled when we defined shared types in #8298, but this missed the case where a non-shared
type definition used a shared abstract heap type, which has no definition. Update the validation to check that the used types are allowed by the enabled feature set as well. Refactor the validation logic into several functions to avoid duplication of logic.
tlively added a commit that referenced this pull request Feb 12, 2026
We started validating that shared-everything is enabled when we defined
shared types in #8298, but this missed the case where a non-shared
type definition used a shared abstract heap type, which has no
definition. Update the validation to check that the used types are
allowed by the enabled feature set as well. Refactor the validation
logic into several functions to avoid duplication of logic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants