summaryrefslogtreecommitdiff
path: root/op.h
diff options
context:
space:
mode:
authorDoug MacEachern <dougm@covalent.net>2001-08-02 13:24:55 -0700
committerJarkko Hietaniemi <jhi@iki.fi>2001-08-03 12:09:50 +0000
commit5f8cb0464db8019389b7bf1816b817fa4d44ca34 (patch)
treedf56724573529c8bbcedb239c398ae4f2abeb257 /op.h
parentbc0a45ed05a5ed25882d9d65d5140ab818bd1fbf (diff)
downloadperl-5f8cb0464db8019389b7bf1816b817fa4d44ca34.tar.gz
[patch] plug PL_regex_padav leaks
Message-ID: <Pine.LNX.4.21.0108022020100.8991-100000@mako.covalent.net> p4raw-id: //depot/perl@11560
Diffstat (limited to 'op.h')
-rw-r--r--op.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/op.h b/op.h
index af0e983712..e92b1d8db4 100644
--- a/op.h
+++ b/op.h
@@ -252,9 +252,13 @@ struct pmop {
#ifdef USE_ITHREADS
#define PM_GETRE(o) ((REGEXP*)SvIVX(PL_regex_pad[(o)->op_pmoffset]))
#define PM_SETRE(o,r) (sv_setiv(PL_regex_pad[(o)->op_pmoffset], (IV)r))
+#define PM_GETRE_SAFE(o) (PL_regex_pad ? PM_GETRE(o) : (REGEXP*)0)
+#define PM_SETRE_SAFE(o,r) if (PL_regex_pad) PM_SETRE(o,r)
#else
#define PM_GETRE(o) ((o)->op_pmregexp)
#define PM_SETRE(o,r) ((o)->op_pmregexp = (r))
+#define PM_GETRE_SAFE PM_GETRE
+#define PM_SETRE_SAFE PM_SETRE
#endif
#define PMdf_USED 0x01 /* pm has been used once already */