Iterator-Collection RC Ownership Contract

6 sections

100%
Overview

Establish a correct, complete, and tested ownership contract between iterators and their source collections in the Ori compiler's AOT pipeline. Currently, the contract has two critical bugs: (1) iterator elem_dec_fn is hardcoded NULL, so element cleanup fails when ori_iter_drop does the final buffer RC dec; (2) the for-yield lowering doesn't properly scope the source collection's lifetime, causing the AIMS pipeline to emit a spurious extra RcDec (double-free). This plan fixes both bugs and audits the full for-do/for-yield parity to prevent similar issues.

In Progress

1 sections

Completed

5 sections