From: Vincent Pit Date: Thu, 1 Oct 2015 13:51:18 +0000 (-0300) Subject: Remove a now obsolete workaround for context stack smashing X-Git-Tag: v0.59~1 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FVariable-Magic.git;a=commitdiff_plain;h=3dac6abb6d4dfdbfe07b780d8b856b1d74eac970 Remove a now obsolete workaround for context stack smashing Since we switch stacks, we also switch context stacks, so this is no longer necessary. --- diff --git a/Magic.xs b/Magic.xs index 432eeed..483431e 100644 --- a/Magic.xs +++ b/Magic.xs @@ -331,8 +331,7 @@ static MAGIC *vmg_sv_magicext(pTHX_ SV *sv, SV *obj, const MGVTBL *vtbl, const v static I32 vmg_call_sv(pTHX_ SV *sv, I32 flags, int (*cleanup)(pTHX_ void *), void *ud) { #define vmg_call_sv(S, F, C, U) vmg_call_sv(aTHX_ (S), (F), (C), (U)) - I32 ret, cxix; - PERL_CONTEXT saved_cx; + I32 ret; SV *old_err = NULL; if (SvTRUE(ERRSV)) { @@ -340,15 +339,8 @@ static I32 vmg_call_sv(pTHX_ SV *sv, I32 flags, int (*cleanup)(pTHX_ void *), vo sv_setsv(ERRSV, &PL_sv_undef); } - cxix = (cxstack_ix < cxstack_max) ? (cxstack_ix + 1) : Perl_cxinc(aTHX); - /* 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]; - ret = call_sv(sv, flags | G_EVAL); - cxstack[cxix] = saved_cx; - if (SvTRUE(ERRSV)) { SvREFCNT_dec(old_err);