Skip to content

Conversation

@kripken
Copy link
Member

@kripken kripken commented Oct 21, 2024

We only checked for the case of the immediate super being public while we
are private, but it might be a grandsuper instead. That is, any ancestor that
is public will prevent GTO from removing a field (since we can only add
fields on top of our ancestors).

@kripken kripken requested a review from tlively October 21, 2024 16:13
;; cannot remove the unused i32 field from its child or grandchild.
(module
;; CHECK: (type $A (sub (struct (field (mut i32)))))
(type $A (sub (struct (field (mut i32)))))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also add a test where the field is not present on $A, so it can still be removed from $B and $C?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, this was actually a bug. The loop on supers here would need to also handle the super not having the field, mirroring the code elsewhere.

Overall this seems to make the assertion more and more complex, past the point of being worth it, so I removed it. We do still cover this in depth in tests.

@kripken kripken merged commit 0d9b750 into WebAssembly:main Oct 22, 2024
13 checks passed
@kripken kripken deleted the gto.fuzz.super branch October 22, 2024 16:17
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