diff options
author | Perl 5 Porters <perl5-porters@africa.nicoh.com> | 1996-07-05 05:01:23 +0000 |
---|---|---|
committer | Charles Bailey <bailey@genetics.upenn.edu> | 1996-07-05 05:01:23 +0000 |
commit | 7d55f6220f027190d816af438b0283662ab1736e (patch) | |
tree | 757a49cf0c69c7b70833f9b81f5c0153f36e37cd | |
parent | d3c495ad146a8ad1994a5560419fcbbd04bdbf87 (diff) | |
download | perl-7d55f6220f027190d816af438b0283662ab1736e.tar.gz |
perl 5.003_01: av.c
Change global symbol 'stack' to avoid collision with other code
Add warning for multiple attampts to delete an AV.
-rw-r--r-- | av.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -94,7 +94,7 @@ I32 key; #endif ary = AvALLOC(av) + AvMAX(av) + 1; tmp = newmax - AvMAX(av); - if (av == stack) { /* Oops, grew stack (via av_store()?) */ + if (av == curstack) { /* Oops, grew stack (via av_store()?) */ stack_sp = AvALLOC(av) + (stack_sp - stack_base); stack_base = AvALLOC(av); stack_max = stack_base + newmax; @@ -196,7 +196,7 @@ SV *val; ary = AvARRAY(av); if (AvFILL(av) < key) { if (!AvREAL(av)) { - if (av == stack && key > stack_sp - stack_base) + if (av == curstack && key > stack_sp - stack_base) stack_sp = stack_base + key; /* XPUSH in disguise */ do ary[++AvFILL(av)] = &sv_undef; @@ -289,6 +289,11 @@ register AV *av; register I32 key; SV** ary; +#ifdef DEBUGGING + if (SvREFCNT(av) <= 0) { + warn("Attempt to clear deleted array"); + } +#endif if (!av || AvMAX(av) < 0) return; /*SUPPRESS 560*/ |