savi-lang / savi

A fast language for programmers who are passionate about their craft.
BSD 3-Clause "New" or "Revised" License
153 stars 12 forks source link

Fix memory safety bugs involving dynamic tracing of a "boxed" struct. #478

Closed jemc closed 3 weeks ago

jemc commented 3 weeks ago

Prior to this commit, we had some bugs in the compiler-generated tracing code for dynamic tracing, leading to situations where the memory for the boxed struct (and for objects nested at various levels within) may not be traced during garbage collection, causing those memory regions to be reclaimed and potentially reused, corrupting the data previously stored in that memory.

This commit fixes those bugs and adds a relevant test.

jemc commented 3 weeks ago

MacOS CI failure is unrelated, so I'm merging anyway.