Skip to content

fix: suffix duplicate exports in multi-memory mode to prevent cross-component collisions#88

Merged
avrabe merged 1 commit intomainfrom
fix/export-dedup-and-shared-types
Apr 3, 2026
Merged

fix: suffix duplicate exports in multi-memory mode to prevent cross-component collisions#88
avrabe merged 1 commit intomainfrom
fix/export-dedup-and-shared-types

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Apr 3, 2026

Summary

In multi-memory mode, each component's shim module exports numeric function names ("0", "1", ...) and a $imports table. When multiple components exist, these names collide and the first-wins dedup silently drops subsequent entries — wiring the fixup module to the wrong component's indirect table.

This causes the intermediate (re-exporter) component's indirect calls to go through the leaf's shim functions instead of its own, corrupting the call chain for 3-component resource chains.

Fix: suffix duplicate export names with $comp_idx in multi-memory mode. SharedMemory mode retains first-wins dedup.

Part of #69.

Test plan

  • 276 tests pass, 0 failures
  • SharedMemory test (test_shared_memory_no_suffixed_realloc_exports) still passes

🤖 Generated with Claude Code

…omponent collisions

In multi-memory mode, each component's shim module exports numeric
function names ("0", "1", ...) and a "$imports" table. When multiple
components exist, these export names collide and the first-wins dedup
silently drops subsequent entries — wiring the fixup module to the
wrong component's indirect table.

Fix: suffix duplicate export names with $comp_idx in multi-memory mode.
SharedMemory mode retains first-wins dedup since all components share
one memory.

Part of #69.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@avrabe avrabe merged commit b357217 into main Apr 3, 2026
4 checks passed
@avrabe avrabe deleted the fix/export-dedup-and-shared-types branch April 3, 2026 00:28
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.

1 participant