-
Notifications
You must be signed in to change notification settings - Fork 702
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
spectest-interp: assert_malformed must error in reader alone #2252
Conversation
091d43e
to
47625af
Compare
return Succeeded( | ||
ValidateModule(&module, &errors, ValidateOptions{s_features})); | ||
} | ||
|
||
bool WellformedIR(const std::string& filename) { | ||
return CheckIR(filename, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "well formed" something that exists in the spec, or something we a creating there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to be the spec's term (e.g. "A byte sequence is a well-formed encoding of a module if and only if it is generated by the grammar." from 5.1). If you think it's better to match the script language, we could call these functions "InvalidIR" and "MalformedIR" (instead of "ValidIR" and "WellformedIR") and just negate the callsites?
src/tools/spectest-interp.cc
Outdated
wabt::Module module; | ||
Errors errors; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert this move of a line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done.
Previously assert_malformed was treated the same as assert_invalid Also fixes a bug where spectest-interp wasn't trying to validate text modules (e.g. `(assert_invalid (module quote "...") "")`).
47625af
to
35d2930
Compare
In the spectest interpreter, currently
assert_malformed
is treated the same asassert_invalid
. This PR requires thatassert_malformed
modules must fail in the reader (not later in validation).This also fixes an issue where
assert_invalid
wasn't validating text modules, so spectest-interp wasn't working properly for something like(assert_invalid (module quote "...") "")
. There aren't a lot of tests like this because usually there's no need for(module quote)
unless it's going to be in an(assert_malformed)
, but the memory64 tests have one because overlarge offsets are moving from a malformed failure to a validation failure. So this is a prerequisite for #2253.This is logically dependent on #2251 (the tests won't pass until #2251 is merged).