Skip to content

fix: heap-allocate array structs in filter, map, split#181

Merged
cs01 merged 3 commits intomainfrom
fix/missing-type-tracking
Mar 10, 2026
Merged

fix: heap-allocate array structs in filter, map, split#181
cs01 merged 3 commits intomainfrom
fix/missing-type-tracking

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Mar 10, 2026

Summary

  • Replace alloca %Array / alloca %StringArray with GC_malloc(24) + bitcast in filter, map, and split codegen
  • Same class of bug as the Set alloca fix (PR fix: replace silent 0.0 fallbacks with compile errors in member access #146) — stack-allocated structs become dangling pointers when stored in class fields
  • Affected: generateNumericArrayFilter, generateStringArrayFilter, generateNumericArrayMap, generateStringArrayMapImpl, generateSplit (both empty and normal paths)
  • Added regression tests: filter-map-in-class.ts and split-in-class.ts that store results in class fields

Test plan

  • All 450 tests pass (2 new)
  • Self-hosting (quick) passes
  • CI

@cs01 cs01 merged commit 1320886 into main Mar 10, 2026
12 checks passed
@cs01 cs01 deleted the fix/missing-type-tracking branch March 12, 2026 05: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.

1 participant