}
}
+
+/* is this container magic (%ENV, $1 etc), or value magic (pos, taint etc)? */
+
+STATIC bool
+S_is_container_magic(const MAGIC *mg)
+{
+ switch (mg->mg_type) {
+ case PERL_MAGIC_bm:
+ case PERL_MAGIC_fm:
+ case PERL_MAGIC_regex_global:
+ case PERL_MAGIC_nkeys:
+#ifdef USE_LOCALE_COLLATE
+ case PERL_MAGIC_collxfrm:
+#endif
+ case PERL_MAGIC_qr:
+ case PERL_MAGIC_taint:
+ case PERL_MAGIC_vec:
+ case PERL_MAGIC_vstring:
+ case PERL_MAGIC_utf8:
+ case PERL_MAGIC_substr:
+ case PERL_MAGIC_defelem:
+ case PERL_MAGIC_arylen:
+ case PERL_MAGIC_pos:
+ case PERL_MAGIC_backref:
+ case PERL_MAGIC_arylen_p:
+ case PERL_MAGIC_rhash:
+ case PERL_MAGIC_symtab:
+ return 0;
+ default:
+ return 1;
+ }
+}
+
/*
=for apidoc mg_get
mg->mg_flags &= ~MGf_GSKIP; /* setting requires another read */
(SSPTR(mgs_ix, MGS*))->mgs_flags = 0;
}
+ if (PL_localizing == 2 && !S_is_container_magic(mg))
+ continue;
if (vtbl && vtbl->svt_set)
CALL_FPTR(vtbl->svt_set)(aTHX_ sv, mg);
}
MAGIC *mg;
for (mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic) {
const MGVTBL* const vtbl = mg->mg_virtual;
- switch (mg->mg_type) {
- /* value magic types: don't copy */
- case PERL_MAGIC_bm:
- case PERL_MAGIC_fm:
- case PERL_MAGIC_regex_global:
- case PERL_MAGIC_nkeys:
-#ifdef USE_LOCALE_COLLATE
- case PERL_MAGIC_collxfrm:
-#endif
- case PERL_MAGIC_qr:
- case PERL_MAGIC_taint:
- case PERL_MAGIC_vec:
- case PERL_MAGIC_vstring:
- case PERL_MAGIC_utf8:
- case PERL_MAGIC_substr:
- case PERL_MAGIC_defelem:
- case PERL_MAGIC_arylen:
- case PERL_MAGIC_pos:
- case PERL_MAGIC_backref:
- case PERL_MAGIC_arylen_p:
- case PERL_MAGIC_rhash:
- case PERL_MAGIC_symtab:
+ if (!S_is_container_magic(mg))
continue;
- }
if ((mg->mg_flags & MGf_LOCAL) && vtbl->svt_local)
(void)CALL_FPTR(vtbl->svt_local)(aTHX_ nsv, mg);
/* return the last filled */
while ( paren >= 0
- && (rx->startp[paren] == -1 || rx->endp[paren] == -1) )
+ && (rx->offs[paren].start == -1
+ || rx->offs[paren].end == -1) )
paren--;
return (U32)paren;
}
if (paren < 0)
return 0;
if (paren <= (I32)rx->nparens &&
- (s = rx->startp[paren]) != -1 &&
- (t = rx->endp[paren]) != -1)
+ (s = rx->offs[paren].start) != -1 &&
+ (t = rx->offs[paren].end) != -1)
{
register I32 i;
if (mg->mg_obj) /* @+ */
paren = atoi(mg->mg_ptr); /* $& is in [0] */
getparen:
if (paren <= (I32)rx->nparens &&
- (s1 = rx->startp[paren]) != -1 &&
- (t1 = rx->endp[paren]) != -1)
+ (s1 = rx->offs[paren].start) != -1 &&
+ (t1 = rx->offs[paren].end) != -1)
{
i = t1 - s1;
getlen:
return 0;
case '`':
if (PL_curpm && (rx = PM_GETRE(PL_curpm))) {
- if (rx->startp[0] != -1) {
- i = rx->startp[0];
+ if (rx->offs[0].start != -1) {
+ i = rx->offs[0].start;
if (i > 0) {
s1 = 0;
t1 = i;
return 0;
case '\'':
if (PL_curpm && (rx = PM_GETRE(PL_curpm))) {
- if (rx->endp[0] != -1) {
- i = rx->sublen - rx->endp[0];
+ if (rx->offs[0].end != -1) {
+ i = rx->sublen - rx->offs[0].end;
if (i > 0) {
- s1 = rx->endp[0];
+ s1 = rx->offs[0].end;
t1 = rx->sublen;
goto getlen;
}
return 0;
}
+/*
+ * The signal handling nomenclature has gotten a bit confusing since the advent of
+ * safe signals. S_raise_signal only raises signals by analogy with what the
+ * underlying system's signal mechanism does. It might be more proper to say that
+ * it defers signals that have already been raised and caught.
+ *
+ * PL_sig_pending and PL_psig_pend likewise do not track signals that are pending
+ * in the sense of being on the system's signal queue in between raising and delivery.
+ * They are only pending on Perl's deferral list, i.e., they track deferred signals
+ * awaiting delivery after the current Perl opcode completes and say nothing about
+ * signals raised but not yet caught in the underlying signal implementation.
+ */
+
#ifndef SIG_PENDING_DIE_COUNT
# define SIG_PENDING_DIE_COUNT 120
#endif
{
dVAR;
PERL_UNUSED_ARG(sv);
- /* update taint status unless we're restoring at scope exit */
- if (PL_localizing != 2) {
- if (PL_tainted)
- mg->mg_len |= 1;
- else
- mg->mg_len &= ~1;
- }
+ /* update taint status */
+ if (PL_tainted)
+ mg->mg_len |= 1;
+ else
+ mg->mg_len &= ~1;
return 0;
}