Skip to content

Let the calling function ran with the correct frame#102

Merged
mohanson merged 3 commits into
masterfrom
fix101
May 13, 2026
Merged

Let the calling function ran with the correct frame#102
mohanson merged 3 commits into
masterfrom
fix101

Conversation

@mohanson
Copy link
Copy Markdown
Collaborator

@mohanson mohanson commented May 12, 2026

Ref #101

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses correctness issues in pywasm’s execution semantics and numeric encoding, motivated by Issue #101 (Go wasip1 modules crashing due to incorrect frame/label handling during calls).

Changes:

  • Fix the function-call label’s frame index so branches/returns unwind to the correct call frame.
  • Adjust f32 serialization to pack values after rounding to float32 (via ctypes.c_float), avoiding overflow errors from struct.pack.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
pywasm/core.py Corrects the label frame index for internal function calls to prevent frame/label mismatches during control-flow unwinding.
pywasm/arith.py Ensures f32 values are rounded to float32 before packing into bytes to avoid packing overflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pywasm/arith.py Outdated
Comment thread pywasm/core.py
@mohanson mohanson merged commit 810518b into master May 13, 2026
3 checks passed
@mohanson mohanson deleted the fix101 branch May 13, 2026 01:35
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