From: Rafael Garcia-Suarez Date: Thu, 1 Dec 2005 15:40:11 +0000 (+0000) Subject: Always define PL_memory_wrap, and use it for the new sprintf checks X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e271e56d5700d8b78a1a9d5ecb4471f81deffa6c;p=p5sagit%2Fp5-mst-13.2.git Always define PL_memory_wrap, and use it for the new sprintf checks p4raw-id: //depot/perl@26239 --- diff --git a/makedef.pl b/makedef.pl index 9737605..a0bcf7d 100644 --- a/makedef.pl +++ b/makedef.pl @@ -660,12 +660,6 @@ else { )]; } -unless ($define{'PERL_MALLOC_WRAP'}) { - skip_symbols [qw( - PL_memory_wrap - )]; -} - if ($define{'PERL_USE_SAFE_PUTENV'}) { skip_symbols [qw( PL_use_safe_putenv diff --git a/perl.h b/perl.h index 39e4f6e..dd05dd1 100644 --- a/perl.h +++ b/perl.h @@ -3800,10 +3800,8 @@ EXTCONST char PL_no_myglob[] INIT("\"my\" variable %s can't be in a package"); EXTCONST char PL_no_localize_ref[] INIT("Can't localize through a reference"); -#ifdef PERL_MALLOC_WRAP EXTCONST char PL_memory_wrap[] INIT("panic: memory wrap"); -#endif EXTCONST char PL_uuemap[65] INIT("`!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"); diff --git a/sv.c b/sv.c index 0b85abe..35faa6a 100644 --- a/sv.c +++ b/sv.c @@ -8891,10 +8891,8 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV /* calculate width before utf8_upgrade changes it */ have = esignlen + zeros + elen; -#ifdef PERL_MALLOC_WRAP if (have < zeros) Perl_croak_nocontext(PL_memory_wrap); -#endif if (is_utf8 != has_utf8) { if (is_utf8) { @@ -8915,10 +8913,8 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV need = (have > width ? have : width); gap = need - have; -#ifdef PERL_MALLOC_WRAP if (need >= (((STRLEN)~0) - SvCUR(sv) - dotstrlen - 1)) Perl_croak_nocontext(PL_memory_wrap); -#endif SvGROW(sv, SvCUR(sv) + need + dotstrlen + 1); p = SvEND(sv); if (esignlen && fill == '0') {