summaryrefslogtreecommitdiff
path: root/av.c
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1996-07-05 05:01:23 +0000
committerCharles Bailey <bailey@genetics.upenn.edu>1996-07-05 05:01:23 +0000
commit7d55f6220f027190d816af438b0283662ab1736e (patch)
tree757a49cf0c69c7b70833f9b81f5c0153f36e37cd /av.c
parentd3c495ad146a8ad1994a5560419fcbbd04bdbf87 (diff)
downloadperl-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.
Diffstat (limited to 'av.c')
-rw-r--r--av.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/av.c b/av.c
index b27ec762a6..dfd25df760 100644
--- a/av.c
+++ b/av.c
@@ -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*/