Skip to content

Conversation

@tlively
Copy link
Member

@tlively tlively commented Feb 10, 2026

When IRBuilder creates a multivalue block wrapping a set and get of a
tuple scratch local, it might be implicitly adding a function type to
the module. Text round-tripping could previously fail if that function
type would conflict with another function type in the module after
binary writing, for example if it contained a bottom reference type with
GC disabled. Fix the problem by generalizing the type of scratch locals
to be the types that will eventually be written to a binary given the
enabled features.

This further pessimizes our handling of multivalue code by losing type
information in the scratch locals, but handling multivalue better will
require a much more systematic change anyway.

Fixes #8279.

When IRBuilder creates a multivalue block wrapping a set and get of a
tuple scratch local, it might be implicitly adding a function type to
the module. Text round-tripping could previously fail if that function
type would conflict with another function type in the module after
binary writing, for example if it contained a bottom reference type with
GC disabled. Fix the problem by generalizing the type of scratch locals
to be the types that will eventually be written to a binary given the
enabled features.

This further pessimizes our handling of multivalue code by losing type
information in the scratch locals, but handling multivalue better will
require a much more systematic change anyway.

Fixes #8279.
@tlively tlively requested a review from kripken February 10, 2026 22:31
Co-authored-by: Alon Zakai <azakai@google.com>
@tlively tlively enabled auto-merge (squash) February 11, 2026 00:08
@tlively tlively merged commit 75c4caa into main Feb 11, 2026
17 checks passed
@tlively tlively deleted the fix-roundtrip-type-conflict branch February 11, 2026 00:54
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.

wat-related fuzz bug with "distinct rec groups would be identical after binary writing"

2 participants