-
Notifications
You must be signed in to change notification settings - Fork 50
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
Validate the function signature of main in binaryen #446
Conversation
Codecov Report
@@ Coverage Diff @@
## master #446 +/- ##
==========================================
+ Coverage 68.51% 68.63% +0.12%
==========================================
Files 8 8
Lines 1045 1049 +4
Branches 136 136
==========================================
+ Hits 716 720 +4
Misses 300 300
Partials 29 29 |
fd448f2
to
733cb6c
Compare
733cb6c
to
15b9dc2
Compare
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.
Ok. I just suggested better error messages.
src/binaryen.cpp
Outdated
ensureCondition( | ||
main_function, | ||
ContractValidationFailure, | ||
"Contract is invalid. \"main\" export doesn't point to a function." |
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.
"main" is not a function
.
(main_function->getNumParams() == 0) && | ||
(main_function->result == wasm::Type::none), | ||
ContractValidationFailure, | ||
"Contract is invalid. \"main\" has an invalid signature." |
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.
(The) "main" function has invalid signature
15b9dc2
to
ab24465
Compare
Part of #441. Fixes #442.