Skip to content

Commit

Permalink
pad.c:pad_fixup_inner_anons: Add assertions
Browse files Browse the repository at this point in the history
These would have made it easier to track down the bug fixed by
the previous commit.
  • Loading branch information
Father Chrysostomos committed Sep 10, 2016
1 parent 6da1306 commit 95c0a76
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pad.c
Original file line number Diff line number Diff line change
Expand Up @@ -2376,6 +2376,7 @@ Perl_pad_fixup_inner_anons(pTHX_ PADLIST *padlist, CV *old_cv, CV *new_cv)
PADNAME **names = namepad;
PADOFFSET i = ix;
while (PadnameOUTER(name)) {
assert(SvTYPE(cv) == SVt_PVCV);
cv = CvOUTSIDE(cv);
names = PadlistNAMESARRAY(CvPADLIST(cv));
i = PARENT_PAD_INDEX(name);
Expand Down Expand Up @@ -2406,6 +2407,7 @@ Perl_pad_fixup_inner_anons(pTHX_ PADLIST *padlist, CV *old_cv, CV *new_cv)
assert(SvWEAKREF(rv));
innercv = (CV *)SvRV(rv);
assert(!CvWEAKOUTSIDE(innercv));
assert(CvOUTSIDE(innercv) == old_cv);
SvREFCNT_dec(CvOUTSIDE(innercv));
CvOUTSIDE(innercv) = (CV *)SvREFCNT_inc_simple_NN(new_cv);
}
Expand Down

0 comments on commit 95c0a76

Please sign in to comment.