/* ... Safe version of call_sv() ........................................... */
-#define VMG_SAVE_LAST_CX (!VMG_HAS_PERL(5, 8, 4) || VMG_HAS_PERL(5, 9, 5))
-
STATIC I32 vmg_call_sv(pTHX_ SV *sv, I32 flags, SV *dsv) {
#define vmg_call_sv(S, F, D) vmg_call_sv(aTHX_ (S), (F), (D))
- I32 ret, cxix = 0, in_eval = 0;
-#if VMG_SAVE_LAST_CX
+ I32 ret, cxix, in_eval = 0;
PERL_CONTEXT saved_cx;
-#endif
SV *old_err = NULL;
if (SvTRUE(ERRSV)) {
}
if (cxstack_ix < cxstack_max) {
- cxix = cxstack_ix + 1;
- if (dsv && CxTYPE(cxstack + cxix) == CXt_EVAL)
- in_eval = 1;
+ cxix = cxstack_ix + 1;
+ in_eval = CxTYPE(cxstack + cxix) == CXt_EVAL;
+ } else {
+ cxix = Perl_cxinc(aTHX);
}
-
-#if VMG_SAVE_LAST_CX
/* The last popped context will be reused by call_sv(), but our callers may
* still need its previous value. Back it up so that it isn't clobbered. */
saved_cx = cxstack[cxix];
-#endif
ret = call_sv(sv, flags | G_EVAL);
-#if VMG_SAVE_LAST_CX
cxstack[cxix] = saved_cx;
-#endif
if (SvTRUE(ERRSV)) {
if (old_err) {