Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions src/tools/wasm-shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ struct Shell {
std::shared_ptr<Module> wasm;
if (auto* quoted = std::get_if<QuotedModule>(&mod.module)) {
wasm = std::make_shared<Module>();
wasm->features = FeatureSet::All;
switch (quoted->type) {
case QuotedModuleType::Text: {
CHECK_ERR(parseModule(*wasm, quoted->module));
Expand Down
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