Skip to content

Conversation

@SiimonDev
Copy link

@SiimonDev SiimonDev commented Nov 26, 2025

Issue:
Currently, ClassInfo stores a parent_ptr that points to the parent class's entry inside the global classes HashMap. However, HashMap stores elements contiguously. When new classes are registered and the map exceeds its capacity, it triggers a resize/reallocation. This moves all existing ClassInfo objects to new memory addresses. Any existing parent_ptr held by child classes becomes a dangling pointer to freed memory. This causes random crashes in get_virtual_func when looking up parent methods, depending on registration order and memory reuse.

Proposed Fix:
Remove parent_ptr and replace it with a dynamic lookup using classes.find(parent_name).

This is the first time doing any kind of pull-requests so if anything looks wrong please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug This has been identified as a bug crash regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants