diff options
author | Nicholas Clark <nick@ccl4.org> | 2009-03-29 20:03:18 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-03-29 20:06:53 +0100 |
commit | 99ab892b6470bcd28bad5512a942b608496ebf8f (patch) | |
tree | 1614b48285f126c71144d5542a01e75a9b0e6ab6 /sv.c | |
parent | 9340c80aaec7d3857f387eea86207c1a9604b2ad (diff) | |
download | perl-99ab892b6470bcd28bad5512a942b608496ebf8f.tar.gz |
Change Perl_newCONSTSUB() so that a NULL sv generates an empty list return.
Don't call DESTROY if it's a constant subroutine.
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -5656,6 +5656,9 @@ Perl_sv_clear(pTHX_ register SV *const sv) stash = SvSTASH(sv); destructor = StashHANDLER(stash,DESTROY); if (destructor + /* A constant subroutine can have no side effects, so + don't bother calling it. */ + && !CvCONST(destructor) /* Don't bother calling an empty destructor */ && (CvISXSUB(destructor) || CvSTART(destructor)->op_next->op_type != OP_LEAVESUB)) |