mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
be36b67a12
mrb_task_mark_all marked a task's live registers but, unlike mark_context_stack in gc.c, never cleared the slots above the live range. When a preempted task's live range later shrank (a frame had returned), the stale object pointers left in those slots were neither marked nor cleared: the objects were swept while the pointers survived. Re-entering the same frame reused those slots, and the next mark of the resumed task hit a freed object, tripping the MRB_TT_FREE assertion in mrb_gc_mark. Clear the dead slots after marking, exactly as mark_context_stack does for the running context. Fixes #6870. Co-authored-by: Claude <noreply@anthropic.com>