When a CV is freed prematurely, it cleans up its op slab. But
SAVEFREEOP may cause the savestack to point to an op in that slab
after the CV has been freed, so SAVEFREEOP is allowed to coun-
termand the freeing of the slab. Every op that is not on the
savestack is freed.
The reference count of the slab was being left off by one. The result
was that when the stack unwinding freed the op, it would leave the
slab behind and leak it.
#ifdef DEBUGGING
assert(savestack_count == slab->opslab_refcnt-1);
#endif
+ /* Remove the CV’s reference count. */
+ slab->opslab_refcnt--;
return;
}
free: