X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=sv.c;h=c92c89c51f618fcdc87af30df3a8fb267c74a277;hb=5bc8ef5059e42d7960e39ba0e920933e41370b70;hp=d944e2f6fc3704bea9f4332457f58e3609f48e32;hpb=7bf7986364dc86acb86c5d83e7512b8dbdcb0165;p=p5sagit%2Fp5-mst-13.2.git diff --git a/sv.c b/sv.c index d944e2f..c92c89c 100644 --- a/sv.c +++ b/sv.c @@ -157,7 +157,7 @@ Public API: =cut -============================================================================ */ + * ========================================================================= */ /* * "A time to plant, and a time to uproot what was planted..." @@ -5655,7 +5655,11 @@ Perl_sv_clear(pTHX_ register SV *const sv) CV* destructor; stash = SvSTASH(sv); destructor = StashHANDLER(stash,DESTROY); - if (destructor) { + if (destructor + /* Don't bother calling an empty destructor */ + && (CvISXSUB(destructor) + || CvSTART(destructor)->op_next->op_type != OP_LEAVESUB)) + { SV* const tmpref = newRV(sv); SvREADONLY_on(tmpref); /* DESTROY() could be naughty */ ENTER; @@ -5972,7 +5976,7 @@ UTF-8 bytes as a single character. Handles magic and type coercion. */ /* - * The length is cached in PERL_UTF8_magic, in the mg_len field. Also the + * The length is cached in PERL_MAGIC_utf8, in the mg_len field. Also the * mg_ptr is used, by sv_pos_u2b() and sv_pos_b2u() - see the comments below. * (Note that the mg_len is not the length of the mg_ptr field. * This allows the cache to store the character length of the string without @@ -6201,7 +6205,7 @@ type coercion. /* * sv_pos_u2b() uses, like sv_pos_b2u(), the mg_ptr of the potential - * PERL_UTF8_magic of the sv to store the mapping between UTF-8 and + * PERL_MAGIC_utf8 of the sv to store the mapping between UTF-8 and * byte offsets. See also the comments of S_utf8_mg_pos_cache_update(). * */ @@ -6444,7 +6448,7 @@ Handles magic and type coercion. /* * sv_pos_b2u() uses, like sv_pos_u2b(), the mg_ptr of the potential - * PERL_UTF8_magic of the sv to store the mapping between UTF-8 and + * PERL_MAGIC_utf8 of the sv to store the mapping between UTF-8 and * byte offsets. * */ @@ -10313,7 +10317,7 @@ ptr_table_* functions. =cut -============================================================================*/ + * =========================================================================*/ #if defined(USE_ITHREADS)