Skip to content

Conversation

kripken
Copy link
Member

@kripken kripken commented May 17, 2024

If we wanted to switch types in such cases we'd need to refinalize (which is likely
worth doing, though other passes should refine globals anyhow).

(I am adding more fuzzing for globals, which is finding these bugs.)

@kripken kripken requested a review from tlively May 17, 2024 23:29
;; CHECK: (global $a (ref $struct) (struct.new_default $struct))
(global $a (ref $struct) (struct.new_default $struct))
;; CHECK: (global $b (ref $struct) (global.get $a))
(global $b (ref $struct) (global.get $a))
Copy link
Member

Choose a reason for hiding this comment

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

What is the role of $b in this test?

Copy link
Member Author

Choose a reason for hiding this comment

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

Just to be comprehensive. $c is equal to both $a and $b but in different ways (it reads $a, but it has equal content to $b). I don't think we optimize both cases atm but this would handle things if we ever did.

@kripken kripken merged commit 3e33605 into WebAssembly:main May 20, 2024
@kripken kripken deleted the sg.sub branch May 20, 2024 18:34
@gkdn gkdn mentioned this pull request Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants