Skip to content

fix: null-defer about data and elem in wasm-interp#2436

Closed
tianstcht wants to merge 2 commits into
WebAssembly:mainfrom
tianstcht:main
Closed

fix: null-defer about data and elem in wasm-interp#2436
tianstcht wants to merge 2 commits into
WebAssembly:mainfrom
tianstcht:main

Conversation

@tianstcht

Copy link
Copy Markdown
Contributor

fix some null-defer case about data and elem.

Comment thread src/interp/interp.cc Outdated
StringPrintf("out of bounds data access: access at %u "
">= max value %" PRIu64,
instr.imm_u32x2.snd,
inst_->datas().size()));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't validation make this impossible?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure the interpreter should be enforcing constraints that the validator should have already enforced... otherwise we will end up duplicating all the validation rules here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There are some formatting issue in the CI log, so I have chosen to use %zu to format vector's size correctly.

@tianstcht tianstcht force-pushed the main branch 2 times, most recently from f92f7fb to 16431b9 Compare June 28, 2024 05:17
@tianstcht

Copy link
Copy Markdown
Contributor Author

The patch also fix issue 2310 and 2311 with the same null-defer bug

@SoniEx2

SoniEx2 commented Jul 2, 2024

Copy link
Copy Markdown
Collaborator

checking the sizes is okay but it's the wrong approach: the module in #2431 should fail validation, it's missing a data section

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