]> git.vpit.fr Git - perl/modules/Variable-Magic.git/commitdiff
Remove a now obsolete workaround for context stack smashing
authorVincent Pit <vince@profvince.com>
Thu, 1 Oct 2015 13:51:18 +0000 (10:51 -0300)
committerVincent Pit <vince@profvince.com>
Thu, 1 Oct 2015 13:51:18 +0000 (10:51 -0300)
Since we switch stacks, we also switch context stacks, so this is no longer
necessary.

Magic.xs

index 432eeed37ba1039d8c4f9f01da4598632e2da201..483431e9eaa6925e4561837fc1f26ab66d51e42d 100644 (file)
--- 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))
 
 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)) {
  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);
  }
 
   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);
 
  ret = call_sv(sv, flags | G_EVAL);
 
- cxstack[cxix] = saved_cx;
-
  if (SvTRUE(ERRSV)) {
   SvREFCNT_dec(old_err);
 
  if (SvTRUE(ERRSV)) {
   SvREFCNT_dec(old_err);