Skip to content

Conversation

@jserv
Copy link
Collaborator

@jserv jserv commented Aug 15, 2025

Fix compiler crash with array initializers like int a[] = {1,2,3}.
Resolves critical bug where compiler terminates with "Unrecognized expression token" when parsing array initialization syntax.

Summary by Bito

This pull request fixes a critical bug in the compiler that caused crashes when handling array initializers. Key changes include updates to ELF offset calculations and new parsing logic to correctly process array initialization syntax. Enhancements were also made in SSA handling and RISC-V code generation.

jserv added 2 commits August 16, 2025 00:53
This resolves critical ARM/RISC-V backend issues:
- Fix stage2 segmentation fault during bootstrap compilation
- Fix exit codes always returning 1 instead of main's return value
- Reorganize code generation to place __syscall trampoline at correct
  offset
Fix compiler crash with array initializers like int a[] = {1,2,3}.
Resolves critical bug where compiler terminates with "Unrecognized
expression token" when parsing array initialization syntax.
- Add parse_array_init() function to handle both implicit and explicit
  arrays
- Fix array address generation to avoid double OP_address_of operations
- Update test suite with comprehensive array initialization test cases
- Improve SSA fallback handling for undefined variables
@jserv jserv merged commit 13e8800 into master Aug 15, 2025
12 checks passed
@jserv jserv deleted the fix-array-init branch August 15, 2025 17:03
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