* by the original comparison routine on the elements pointed to.
* Because we don't move the elements of list1 around through
* this phase, we can break ties on elements that compare equal
- * using their address in the list1 array, ensuring stabilty.
+ * using their address in the list1 array, ensuring stability.
* This leaves us with something looking like
*
* indir list1
if (!(flags & OPf_SPECIAL)) {
cx->cx_type = CXt_SUB;
cx->blk_gimme = G_SCALAR;
+ /* If our comparison routine is already active (CvDEPTH is
+ * is not 0), then PUSHSUB does not increase the refcount,
+ * so we have to do it ourselves, because the LEAVESUB fur-
+ * ther down lowers it. */
+ if (CvDEPTH(cv)) SvREFCNT_inc_simple_void_NN(cv);
PUSHSUB(cx);
if (!is_xsub) {
AV* const padlist = CvPADLIST(cv);