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

Wrong error message in case of validation error #270

Open
vouillon opened this issue Feb 3, 2025 · 2 comments
Open

Wrong error message in case of validation error #270

vouillon opened this issue Feb 3, 2025 · 2 comments

Comments

@vouillon
Copy link
Contributor

vouillon commented Feb 3, 2025

Running this test program, I get the following error:

$ ./bin/wizeng.x86-linux  -ext:gc -ext:exception-handling ./print_array.wasm 
./print_array.wasm:0x3D04:Code[49]: expected 148 data segments, missing data section

We should get the following validation error instead:

 ./bin/wizeng.x86-linux  -ext:gc -ext:exception-handling ./print_array.wasm 
./print_array.wasm:0x7F82:Code[49]: expected type (ref array #0), got i32

The issue is that in case of validation error, the parsing is interrupted but the check for missing data section is still performed, overriding the previous error.

@titzer
Copy link
Owner

titzer commented Feb 3, 2025

Ok, looks like this is due to the location where the error is being report. Generally, Wizard tries to report the error at the earliest byte. It could, e.g. report the missing data section at the end of the module, and any previous error would then have precedence. Wdyt?

@vouillon
Copy link
Contributor Author

vouillon commented Feb 3, 2025

The data section is not missing. But since the parsing is interrupted before reaching the data section due to the validation error, the check for a missing data section fails. I think the check should be skipped if there is a pending error.

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

No branches or pull requests

2 participants