Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Insert CheckRefs after calling destructors
Destructors may leak references of "self" through mutable references stored in "self". For example, a value storing a `mut Array[mut X]` could leak "self" (provided it's of type X) by pushing "self" into said array. To solve this we now insert the CheckRefs instruction _after_ calling a destructor. For correct programs this won't make a difference, while incorrect programs _may_ perform some redundant work in a destructor before terminating with a panic. This fixes https://gitlab.com/inko-lang/inko/-/issues/254. Changelog: fixed
- Loading branch information