diff options
author | 2019-12-30 02:13:39 +0000 | |
---|---|---|
committer | 2019-12-30 02:13:39 +0000 | |
commit | b46d8ef224b95de1dddcd1f01c1ab482f0ab3778 (patch) | |
tree | d2f52131b958c4ff07ad63ffe82dc041240a20f0 /gnu/usr.bin/perl/scope.c | |
parent | Import perl-5.30.1 (diff) | |
download | wireguard-openbsd-b46d8ef224b95de1dddcd1f01c1ab482f0ab3778.tar.xz wireguard-openbsd-b46d8ef224b95de1dddcd1f01c1ab482f0ab3778.zip |
Fix merge issues, remove excess files - match perl-5.30.1 dist
Timing is good deraadt@, OK sthen@
Diffstat (limited to 'gnu/usr.bin/perl/scope.c')
-rw-r--r-- | gnu/usr.bin/perl/scope.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/gnu/usr.bin/perl/scope.c b/gnu/usr.bin/perl/scope.c index 83a7b768935..3e4ee4344b5 100644 --- a/gnu/usr.bin/perl/scope.c +++ b/gnu/usr.bin/perl/scope.c @@ -1253,15 +1253,26 @@ Perl_leave_scope(pTHX_ I32 base) case SAVEt_DELETE: a0 = ap[0]; a1 = ap[1]; a2 = ap[2]; + /* hv_delete could die, so free the key and SvREFCNT_dec the + * hv by pushing new save actions + */ + /* ap[0] is the key */ + ap[1].any_uv = SAVEt_FREEPV; /* was len */ + /* ap[2] is the hv */ + ap[3].any_uv = SAVEt_FREESV; /* was SAVEt_DELETE */ + PL_savestack_ix += 4; (void)hv_delete(a2.any_hv, a0.any_pv, a1.any_i32, G_DISCARD); - SvREFCNT_dec(a2.any_hv); - Safefree(a0.any_ptr); break; case SAVEt_ADELETE: a0 = ap[0]; a1 = ap[1]; + /* av_delete could die, so SvREFCNT_dec the av by pushing a + * new save action + */ + ap[0].any_av = a1.any_av; + ap[1].any_uv = SAVEt_FREESV; + PL_savestack_ix += 2; (void)av_delete(a1.any_av, a0.any_iv, G_DISCARD); - SvREFCNT_dec(a1.any_av); break; case SAVEt_DESTRUCTOR_X: |