Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/wasm/wasm-type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2419,6 +2419,12 @@ bool isValidSupertype(const HeapTypeInfo& sub, const HeapTypeInfo& super) {
if (!super.described || sub.described->supertype != super.described) {
return false;
}
} else {
// A supertype of a type without a describes clause must also not have a
// describes clause.
if (super.described) {
return false;
}
Copy link
Member

Choose a reason for hiding this comment

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

I believe this is not correct, but the spec changed and I'm not sure - @tlively ?

Copy link
Member

Choose a reason for hiding this comment

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

This is correct! We do not allow this:

(type $foo (descriptor $super) (struct))
(type $super (sub (describes $foo) (struct)))
(type $sub (sub $super) (struct))

}
SubTyper typer;
switch (sub.kind) {
Expand Down
Loading