register PERL_CONTEXT *cx;
OP *retop;
- /* I'm not sure why, but executing the format leaves an extra value on the
- * stack. There's probably a better place to be handling this (probably
- * by avoiding pushing it in the first place!) but I don't quite know
- * where to look. -doy */
- (void)POPs;
-
if (!io || !(ofp = IoOFP(io)))
goto forget_top;
gv_efullname4(sv, fgv, NULL, FALSE);
DIE(aTHX_ "Undefined top format \"%"SVf"\" called", SVfARG(sv));
}
- RETURNOP(doform(cv, gv, PL_op));
+ return doform(cv, gv, PL_op);
}
forget_top:
POPBLOCK(cx,PL_curpm);
POPFORMAT(cx);
retop = cx->blk_sub.retop;
+ SP = newsp; /* ignore retval of formline */
LEAVE;
fp = IoOFP(io);
}
/* bad_ofp: */
PL_formtarget = PL_bodytarget;
- PERL_UNUSED_VAR(newsp);
PERL_UNUSED_VAR(gimme);
RETURNOP(retop);
}