Skip to content

Fix cross-module return_calls in the interpreter#8083

Merged
kripken merged 3 commits into
WebAssembly:mainfrom
kripken:retcall.other
Dec 2, 2025
Merged

Fix cross-module return_calls in the interpreter#8083
kripken merged 3 commits into
WebAssembly:mainfrom
kripken:retcall.other

Conversation

@kripken
Copy link
Copy Markdown
Member

@kripken kripken commented Dec 2, 2025

If the return-called method is from another module, we need to call
from that runner instance.

@kripken kripken requested a review from tlively December 2, 2025 18:42
Comment thread src/wasm-interpreter.h

if (nextData->self != this) {
// This function is in another module. Call from there.
auto other = (decltype(this))nextData->self;
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.

Yikes! I wonder if this could be avoided with an abstract base class or something like that.

Copy link
Copy Markdown
Member Author

@kripken kripken Dec 2, 2025

Choose a reason for hiding this comment

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

Hmm, the templating makes that messy, or at least I can't find a good solution. Trying both natural and artificial intelligence, the best idea is multiple inheritance, which I'm not sure I like...

But open to improving this if we find something.

@kripken kripken merged commit 73c3a05 into WebAssembly:main Dec 2, 2025
17 checks passed
@kripken kripken deleted the retcall.other branch December 2, 2025 23:16
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.

2 participants