Skip to content

Allow subtypes in tuple operations #2700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 23, 2020

Conversation

tlively
Copy link
Member

@tlively tlively commented Mar 17, 2020

Some optimizations may replace tuple elements with simpler values, and
those simpler values may be a subtype of the original value. Tuple
operations should continue to validate without being refinalized in
these cases.

Some optimizations may replace tuple elements with simpler values, and
those simpler values may be a subtype of the original value. Tuple
operations should continue to validate without being refinalized in
these cases.
@tlively tlively requested a review from kripken March 17, 2020 23:54
@tlively
Copy link
Member Author

tlively commented Mar 17, 2020

This fixes a bug found by the fuzzer in the coalesce-locals pass, but the reduced test case is still rather complex and I don't quite grok how coalesce-locals works, so I don't have a simple test case.

@@ -1914,7 +1914,7 @@ void FunctionValidator::visitTupleMake(TupleMake* curr) {
}
types.push_back(op->type);
}
shouldBeTrue(Type(types) == curr->type,
shouldBeTrue(Type::isSubType(Type(types), curr->type),
Copy link
Member

Choose a reason for hiding this comment

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

We have shouldBeSubType (and shouldBeSubTypeOrFirstIsUnreachable too as a counterpart of shouldBeEqualOrFirstIsUnreachable, even though this is not necessary here). The same for below.

@tlively tlively merged commit 18fcad6 into WebAssembly:master Mar 23, 2020
@kripken
Copy link
Member

kripken commented Mar 23, 2020

This seems to have broken CI on master, e.g. https://api.travis-ci.org/v3/job/666072048/log.txt

kripken added a commit that referenced this pull request Mar 24, 2020
@tlively tlively deleted the tuple-subtype-validate branch April 24, 2020 23:25
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.

3 participants