diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2004-06-07 23:09:42 +0300 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2004-06-08 13:44:27 +0000 |
commit | 2b573acec7886e18e5f2804e8915073100dce2e4 (patch) | |
tree | 60c48c757c95672d726a096029840f65f872f61b /pp_hot.c | |
parent | 7b614c55f5b832a2a6bef87f61ab8323c0d06c60 (diff) | |
download | perl-2b573acec7886e18e5f2804e8915073100dce2e4.tar.gz |
Re: [PATCH] Re: Lack of error for large string on Solaris
Message-ID: <40C4A156.5030205@iki.fi>
p4raw-id: //depot/perl@22904
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -2879,6 +2879,18 @@ PP(pp_aelem) RETPUSHUNDEF; svp = av_fetch(av, elem, lval && !defer); if (lval) { +#ifdef PERL_MALLOC_WRAP + static const char oom_array_extend[] = + "Out of memory during array extend"; /* Duplicated in av.c */ + if (SvUOK(elemsv)) { + UV uv = SvUV(elemsv); + elem = uv > IV_MAX ? IV_MAX : uv; + } + else if (SvNOK(elemsv)) + elem = (IV)SvNV(elemsv); + if (elem > 0) + MEM_WRAP_CHECK_1(elem,SV*,oom_array_extend); +#endif if (!svp || *svp == &PL_sv_undef) { SV* lv; if (!defer) |