Skip to content

fix: replace inline anonymous type assertions with named ast types in…#110

Merged
cs01 merged 1 commit intomainfrom
fix/inline-type-assertions
Mar 7, 2026
Merged

fix: replace inline anonymous type assertions with named ast types in…#110
cs01 merged 1 commit intomainfrom
fix/inline-type-assertions

Conversation

@cs01
Copy link
Owner

@cs01 cs01 commented Mar 7, 2026

Summary

  • Replaced ~25 inline anonymous multi-field type assertions (as { type: string; name: string }) in src/codegen/ with named AST types from src/ast/types.ts
  • Fixes latent SIGSEGV crashes in the native compiler: accessing index > 0 fields on anonymous inline types through union-typed interface fields (like Expression) triggers csyyjson_obj_get on flat pointer arrays instead of direct GEP
  • Left integer-analysis.ts unchanged (5 hits) — those use object[] params, not union-typed interface fields, and are safe by design

Test plan

  • npm test — all 426 tests pass
  • bash scripts/self-hosting.sh --quick — Stage 0 and Stage 1 self-hosting succeed

@cs01 cs01 merged commit 541539c into main Mar 7, 2026
12 checks passed
@cs01 cs01 deleted the fix/inline-type-assertions branch March 7, 2026 07:44
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