summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-01-21 17:21:40 +0000
committerNicholas Clark <nick@ccl4.org>2008-01-21 17:21:40 +0000
commitc5bed6a7fce592c2ad5feb351b09e8f9ce8c18c5 (patch)
treec46406289583a47a274f9be300d5da5add99af95
parent99710fe38e53c8e763d4758979c48cc5bc8503cf (diff)
downloadperl-c5bed6a7fce592c2ad5feb351b09e8f9ce8c18c5.tar.gz
In struct block_subst, access the member once via a macro CxONCE()
which will allow the storage location to be changed. p4raw-id: //depot/perl@33034
-rw-r--r--cop.h2
-rw-r--r--pp_ctl.c2
-rw-r--r--scope.c2
3 files changed, 4 insertions, 2 deletions
diff --git a/cop.h b/cop.h
index ccf910b46a..7c4c721618 100644
--- a/cop.h
+++ b/cop.h
@@ -650,6 +650,8 @@ struct subst {
rxres_save(&cx->sb_rxres, rx); \
(void)ReREFCNT_inc(rx)
+#define CxONCE(cx) (0 + cx->sb_once)
+
#define POPSUBST(cx) cx = &cxstack[cxstack_ix--]; \
rxres_free(&cx->sb_rxres); \
ReREFCNT_dec(cx->sb_rx)
diff --git a/pp_ctl.c b/pp_ctl.c
index e82197208b..50a9df66c0 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -234,7 +234,7 @@ PP(pp_substcont)
FREETMPS; /* Prevent excess tmp stack */
/* Are we done */
- if (cx->sb_once || !CALLREGEXEC(rx, s, cx->sb_strend, orig,
+ if (CxONCE(cx) || !CALLREGEXEC(rx, s, cx->sb_strend, orig,
s == m, cx->sb_targ, NULL,
((cx->sb_rflags & REXEC_COPY_STR)
? (REXEC_IGNOREPOS|REXEC_NOT_FIRST)
diff --git a/scope.c b/scope.c
index 4ee0f10bc2..9cbd13ce24 100644
--- a/scope.c
+++ b/scope.c
@@ -1112,7 +1112,7 @@ Perl_cx_dump(pTHX_ PERL_CONTEXT *cx)
PerlIO_printf(Perl_debug_log, "SB_RFLAGS = %ld\n",
(long)cx->sb_rflags);
PerlIO_printf(Perl_debug_log, "SB_ONCE = %ld\n",
- (long)cx->sb_once);
+ (long)CxONCE(cx));
PerlIO_printf(Perl_debug_log, "SB_ORIG = %s\n",
cx->sb_orig);
PerlIO_printf(Perl_debug_log, "SB_DSTR = 0x%"UVxf"\n",