Wasm R2R: push this before retbuf in InterpToR2R thunk args#129356
Open
AndyAyersMS wants to merge 1 commit into
Open
Wasm R2R: push this before retbuf in InterpToR2R thunk args#129356AndyAyersMS wants to merge 1 commit into
AndyAyersMS wants to merge 1 commit into
Conversation
The thunk pushed retbuf before this, but the JIT (lvaInitArgs) and WasmR2RToInterpreterThunk both expect (, [this], [retbuf], ...). Swap the two if-blocks so interp -> R2R calls match. Fixes dotnet#129347 (NRE / pMT->Validate assert for Synchronized + struct return).
Member
Author
|
@davidwrighton PTAL |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the Wasm interpreter→R2R thunk argument ordering so that generated call_indirect argument stacks match the calling convention expected by the JIT (Compiler::lvaInitArgs) and the reverse thunk (WasmR2RToInterpreterThunkNode), specifically placing this before retbuf.
Changes:
- Reorders the interpreter→R2R thunk argument pushes from
($sp, [retbuf], [this], ...)to($sp, [this], [retbuf], ...). - Updates the inline documentation to reflect the corrected parameter order and align it with the JIT / reverse-thunk assumptions.
davidwrighton
approved these changes
Jun 13, 2026
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.
The thunk pushed retbuf before this, but the JIT (lvaInitArgs) and WasmR2RToInterpreterThunk both expect (, [this], [retbuf], ...). Swap the two if-blocks so interp -> R2R calls match. Fixes #129347 (NRE / pMT->Validate assert for Synchronized + struct return).