Fix array.new_default validation for non-defaultable element types (#4853)#4924
Open
orange-dot wants to merge 1 commit intobytecodealliance:mainfrom
Open
Fix array.new_default validation for non-defaultable element types (#4853)#4924orange-dot wants to merge 1 commit intobytecodealliance:mainfrom
orange-dot wants to merge 1 commit intobytecodealliance:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix loader validation so
array.new_defaultrejects array types whose element type is non-defaultable.Root Cause
The wasm/interpreter loader accepted
array.new_defaultfor array element reference types that cannot have a default value, which allowed an invalid module to get past validation.Changes
array.new_defaultin the wasm/interpreter loader patharray.new,array.new_fixed, and runtime/AOT paths unchanged.wasmloadImpact
Invalid
.wasmmodules usingarray.new_defaultwith non-defaultable element types now fail in the wasm/interpreter load/validation path instead of being accepted.This PR does not extend the same validation to external or pre-existing
.aotartifacts.Validation
tests/unit/gclane inbuild/unit-gc-4853ctest --test-dir build/unit-gc-4853 -R WasmGCTest --output-on-failuretests/unitX86_64FULL_TEST=ONvalidation pass and got1763/1768passingWasmGCTest.Test_array_new_default_non_defaultable_elemalso passed in that broader runllm-enhanced-testAOT/toolchain-dependent cases, and one host-resource-heavymemory648GB caseNotes