Skip to content

fix allocator mismatch in deferred_numeric_literals append#9221

Open
Anton-4 wants to merge 1 commit intomainfrom
fix-allocator-panic
Open

fix allocator mismatch in deferred_numeric_literals append#9221
Anton-4 wants to merge 1 commit intomainfrom
fix-allocator-panic

Conversation

@Anton-4
Copy link
Collaborator

@Anton-4 Anton-4 commented Feb 28, 2026

The e_typed_int and e_typed_frac handlers used self.gpa (the checker's worker allocator) instead of self.cir.gpa (the ModuleEnv's allocator) when appending to deferred_numeric_literals. Since the list was initialized with the ModuleEnv allocator, using a different allocator to resize it caused an "Invalid free" panic from the debug allocator's canary check.

Also uncomment the guard pattern demo in all_syntax_test.roc which was previously disabled.

The e_typed_int and e_typed_frac handlers used self.gpa (the checker's
worker allocator) instead of self.cir.gpa (the ModuleEnv's allocator)
when appending to deferred_numeric_literals. Since the list was
initialized with the ModuleEnv allocator, using a different allocator
to resize it caused an "Invalid free" panic from the debug allocator's
canary check.

Also uncomment the guard pattern demo in all_syntax_test.roc which
was previously disabled due to this bug.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Anton-4
Copy link
Collaborator Author

Anton-4 commented Feb 28, 2026

Benchmark failure is expected.

@Anton-4 Anton-4 requested a review from rtfeldman February 28, 2026 15:50
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