mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
81f98a3925
Since `callinfo::blk` is not marked in the GC, it may be reclaimed in the sweep phase. When it reclaimed, it will become either (a) a non Proc object, or (b) a Proc object that happen to have the same address. For case (a), adding `b->tt == MRB_TT_PROC` check works. We should avoid the following `MRB_PROC_STRICT_P()` and `MRB_PROC_ENV()` operations for non Proc objects. For case (b), `MRB_PROC_ENV(b) == CI_ENV(&c->ci[-1])` check should work. Unrelated Proc objects should be filtered by the check. We don't need to clear `callinfo::blk` by `NULL` because the callinfo struct will be discarded afterward in the `cipop()` function.