Skip to content

Conversation

@jserv
Copy link
Collaborator

@jserv jserv commented Aug 7, 2025

This commit adds bounds checking to add_type and increase MAX_TYPES to 128, fixing memory corruption during stage-1 compilation when typedef count exceeds limit.

Summary by Bito

This pull request fixes a critical bug by increasing the maximum number of types from 64 to 128, preventing buffer overflow during type array allocation. It also adds bounds checking in the add_type function to avoid memory corruption during stage-1 compilation, enhancing the stability of the type management system.

This commit adds bounds checking to add_type and increase MAX_TYPES to
128, fixing memory corruption during stage-1 compilation when typedef
count exceeds limit.
Copy link
Collaborator

@ChAoSUnItY ChAoSUnItY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've cherry picked this patch and confirmed it was caused by insufficient buffer capacity, which fixes #226.

@jserv jserv merged commit 396a595 into master Aug 7, 2025
12 checks passed
@jserv jserv deleted the fix-regression branch August 7, 2025 06:55
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.

3 participants