Skip to content
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

Enable "too many results" stack height validation #356

Merged
merged 3 commits into from
Jun 8, 2020

Conversation

chfast
Copy link
Collaborator

@chfast chfast commented May 27, 2020

Requires #355.

@chfast chfast requested review from axic and gumb0 May 27, 2020 21:32
@@ -160,7 +180,7 @@ TEST(validation_stack, loop_with_result_stack_underflow)
EXPECT_THROW_MESSAGE(parse(wasm), validation_error, "stack underflow");
}

TEST(validation_stack, DISABLED_loop_too_many_results)
TEST(validation_stack, loop_too_many_results)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Another test suggestion, not sure if already exists: unreachable insrtuction after br that would push extra result, but should be valid, as it's unreachable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is actually invalid. You cannot have additional items in polymorphic stack.

@chfast chfast force-pushed the stack_height_validation branch from 2da5e2c to 71ef8ae Compare May 28, 2020 13:49
@chfast chfast force-pushed the stack_height_validation branch from 71ef8ae to 5953401 Compare June 8, 2020 17:23
@chfast chfast force-pushed the stack_height_validation branch from 89039ef to 80b015e Compare June 8, 2020 17:39
@chfast chfast marked this pull request as ready for review June 8, 2020 17:40
@codecov
Copy link

codecov bot commented Jun 8, 2020

Codecov Report

Merging #356 into master will increase coverage by 0.17%.
The diff coverage is 45.65%.

@@            Coverage Diff             @@
##           master     #356      +/-   ##
==========================================
+ Coverage   98.94%   99.11%   +0.17%     
==========================================
  Files          42       42              
  Lines       12317    12357      +40     
==========================================
+ Hits        12187    12248      +61     
+ Misses        130      109      -21     

@@ -252,8 +252,8 @@ jobs:
- benchmark:
min_time: "0.01"
- spectest:
expected_passed: 4903
expected_failed: 529
expected_passed: 4997
Copy link
Collaborator

Choose a reason for hiding this comment

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

wow nice increase

My PRs are getting like 2 new tests passed 😖

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is part of type validation, so I expect it has a lot of test cases.

@@ -482,6 +502,33 @@ TEST(validation_stack, unreachable_call_indirect)
parse(wasm);
}

TEST(validation_stack, unreachable_too_many_results)
{
// TODO: These are actually examples of invalid wasm.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Then maybe better to make it disabled tests expecting exception?

@chfast chfast force-pushed the stack_height_validation branch from 80b015e to 553a7d6 Compare June 8, 2020 19:18
@chfast chfast merged commit c6296e3 into master Jun 8, 2020
@chfast chfast deleted the stack_height_validation branch June 8, 2020 20:17
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.

2 participants