Skip to content

Commit ef6e5f5

Browse files
committed
fix(wasm): multi-module FuncRef resolution and void function handling (v0.4.45)
- Per-module func_map snapshots: FuncRef(id) is only unique within a module, so each module now gets its own FuncId→wasm_idx mapping - Void function tracking: void functions push TAG_UNDEFINED after call for stack consistency - Missing argument padding: optional params padded with TAG_UNDEFINED
1 parent d13de8c commit ef6e5f5

4 files changed

Lines changed: 143 additions & 74 deletions

File tree

CLAUDE.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
88

99
Perry is a native TypeScript compiler written in Rust that compiles TypeScript source code directly to native executables. It uses SWC for TypeScript parsing and Cranelift for code generation.
1010

11-
**Current Version:** 0.4.44
11+
**Current Version:** 0.4.45
1212

1313
## Workflow Requirements
1414

@@ -140,6 +140,9 @@ Projects can list npm packages to compile natively instead of routing to V8. Con
140140

141141
## Recent Changes
142142

143+
### v0.4.45
144+
- fix(wasm): multi-module `FuncRef` resolution — per-module func_map snapshots prevent cross-module FuncId collisions; void function tracking pushes TAG_UNDEFINED for stack consistency; missing arguments padded with TAG_UNDEFINED for optional params
145+
143146
### v0.4.44
144147
- fix: `obj[numericKey]` on `Record<number, T>` returned garbage — `IndexGet` treated all numeric indices as array offsets; now detects non-array objects in both the union-index dispatch path and the plain-index fallback, converting numeric keys to strings via `js_jsvalue_to_string` for property lookup. Also fixed `is_string_index_expr_get` treating all `PropertyGet` as string-producing (broke `obj[classField]` where field is number).
145148
- fix: `!('key' in obj)` always returned false — `in` operator returns NaN-boxed TAG_TRUE/TAG_FALSE but `!` used float comparison (NaN != 0.0 is true); added `Expr::In` to `needs_truthy_check`. Root cause of ethkit `Contract()` SIGSEGV: provider detection ternary evaluated wrong branch, setting `provider` to `undefined`.

Cargo.lock

Lines changed: 24 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ opt-level = "s" # Optimize for size in stdlib
8585
opt-level = 3
8686

8787
[workspace.package]
88-
version = "0.4.44"
88+
version = "0.4.45"
8989
edition = "2021"
9090
license = "MIT"
9191
repository = "https://github.com/PerryTS/perry"

0 commit comments

Comments
 (0)