summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Pit <perl@profvince.com>2009-07-25 00:15:07 +0200
committerVincent Pit <perl@profvince.com>2009-07-25 23:26:06 +0200
commit91d1c79f6c648258e3465cf0cdbe8df3ab262de1 (patch)
tree80fc2bb47eae65d7017d956e3759daf004420d29
parent2788925507d099c7b1e9382ad2ddc4f3d692de28 (diff)
downloadperl-91d1c79f6c648258e3465cf0cdbe8df3ab262de1.tar.gz
Introduce save_aelem_flags()
It's the symmetric of save_helem_flags(). save_aelem() is now a macro wrapping around save_aelem_flags().
-rw-r--r--embed.fnc3
-rw-r--r--embed.h4
-rw-r--r--global.sym2
-rw-r--r--proto.h8
-rw-r--r--scope.c6
-rw-r--r--scope.h1
6 files changed, 15 insertions, 9 deletions
diff --git a/embed.fnc b/embed.fnc
index 0001d1fe76..bfc9425823 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -882,7 +882,8 @@ Apda |char* |savesharedpvn |NN const char *const pv|const STRLEN len
Apda |char* |savesvpv |NN SV* sv
Ap |void |savestack_grow
Ap |void |savestack_grow_cnt |I32 need
-Ap |void |save_aelem |NN AV* av|I32 idx|NN SV **sptr
+Amp |void |save_aelem |NN AV* av|I32 idx|NN SV **sptr
+Ap |void |save_aelem_flags|NN AV* av|I32 idx|NN SV **sptr|const U32 flags
Ap |I32 |save_alloc |I32 size|I32 pad
Ap |void |save_aptr |NN AV** aptr
Ap |AV* |save_ary |NN GV* gv
diff --git a/embed.h b/embed.h
index e702d32a47..b602464052 100644
--- a/embed.h
+++ b/embed.h
@@ -773,7 +773,7 @@
#define savesvpv Perl_savesvpv
#define savestack_grow Perl_savestack_grow
#define savestack_grow_cnt Perl_savestack_grow_cnt
-#define save_aelem Perl_save_aelem
+#define save_aelem_flags Perl_save_aelem_flags
#define save_alloc Perl_save_alloc
#define save_aptr Perl_save_aptr
#define save_ary Perl_save_ary
@@ -3111,7 +3111,7 @@
#define savesvpv(a) Perl_savesvpv(aTHX_ a)
#define savestack_grow() Perl_savestack_grow(aTHX)
#define savestack_grow_cnt(a) Perl_savestack_grow_cnt(aTHX_ a)
-#define save_aelem(a,b,c) Perl_save_aelem(aTHX_ a,b,c)
+#define save_aelem_flags(a,b,c,d) Perl_save_aelem_flags(aTHX_ a,b,c,d)
#define save_alloc(a,b) Perl_save_alloc(aTHX_ a,b)
#define save_aptr(a) Perl_save_aptr(aTHX_ a)
#define save_ary(a) Perl_save_ary(aTHX_ a)
diff --git a/global.sym b/global.sym
index 474e6bb307..73bf5be818 100644
--- a/global.sym
+++ b/global.sym
@@ -433,7 +433,7 @@ Perl_savesharedpvn
Perl_savesvpv
Perl_savestack_grow
Perl_savestack_grow_cnt
-Perl_save_aelem
+Perl_save_aelem_flags
Perl_save_alloc
Perl_save_aptr
Perl_save_ary
diff --git a/proto.h b/proto.h
index b2e9e90a14..77464c59a2 100644
--- a/proto.h
+++ b/proto.h
@@ -2746,10 +2746,14 @@ PERL_CALLCONV char* Perl_savesvpv(pTHX_ SV* sv)
PERL_CALLCONV void Perl_savestack_grow(pTHX);
PERL_CALLCONV void Perl_savestack_grow_cnt(pTHX_ I32 need);
-PERL_CALLCONV void Perl_save_aelem(pTHX_ AV* av, I32 idx, SV **sptr)
+/* PERL_CALLCONV void Perl_save_aelem(pTHX_ AV* av, I32 idx, SV **sptr)
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_3); */
+
+PERL_CALLCONV void Perl_save_aelem_flags(pTHX_ AV* av, I32 idx, SV **sptr, const U32 flags)
__attribute__nonnull__(pTHX_1)
__attribute__nonnull__(pTHX_3);
-#define PERL_ARGS_ASSERT_SAVE_AELEM \
+#define PERL_ARGS_ASSERT_SAVE_AELEM_FLAGS \
assert(av); assert(sptr)
PERL_CALLCONV I32 Perl_save_alloc(pTHX_ I32 size, I32 pad);
diff --git a/scope.c b/scope.c
index 20e027ff8e..85f1c48f8b 100644
--- a/scope.c
+++ b/scope.c
@@ -572,12 +572,12 @@ S_save_pushptri32ptr(pTHX_ void *const ptr1, const I32 i, void *const ptr2,
}
void
-Perl_save_aelem(pTHX_ AV *av, I32 idx, SV **sptr)
+Perl_save_aelem_flags(pTHX_ AV *av, I32 idx, SV **sptr, const U32 flags)
{
dVAR;
SV *sv;
- PERL_ARGS_ASSERT_SAVE_AELEM;
+ PERL_ARGS_ASSERT_SAVE_AELEM_FLAGS;
SvGETMAGIC(*sptr);
save_pushptri32ptr(SvREFCNT_inc_simple(av), idx, SvREFCNT_inc(*sptr),
@@ -585,7 +585,7 @@ Perl_save_aelem(pTHX_ AV *av, I32 idx, SV **sptr)
/* if it gets reified later, the restore will have the wrong refcnt */
if (!AvREAL(av) && AvREIFY(av))
SvREFCNT_inc_void(*sptr);
- save_scalar_at(sptr, SAVEf_SETMAGIC); /* XXX - FIXME - see #60360 */
+ save_scalar_at(sptr, flags); /* XXX - FIXME - see #60360 */
sv = *sptr;
/* If we're localizing a tied array element, this new sv
* won't actually be stored in the array - so it won't get
diff --git a/scope.h b/scope.h
index 2b57fc6e99..7bda4c8b5b 100644
--- a/scope.h
+++ b/scope.h
@@ -58,6 +58,7 @@
#define SAVEf_SETMAGIC 1
+#define save_aelem(av,idx,sptr) save_aelem_flags(av,idx,sptr,SAVEf_SETMAGIC)
#define save_helem(hv,key,sptr) save_helem_flags(hv,key,sptr,SAVEf_SETMAGIC)
#ifndef SCOPE_SAVES_SIGNAL_MASK