From f65e70f560c80556143956eb9980619a9dfbe2f4 Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Fri, 31 May 2013 21:39:01 +0100 Subject: make PL_reg_curpm global Currently PL_reg_curpm is actually #deffed to a field within PL_reg_state; promote it into a fully autonomous perl-interpreter variable. PL_reg_curpm points to a fake PMOP that's used to temporarily point PL_curpm to, that we can hang the current regex off, so that this works: "a" =~ /^(.)(?{ print $1 })/ # prints 'a' It turns out that it doesn't need to be saved and restored when we recursively enter the regex engine; that is already handled by saving and restoring which regex is currently attached to PL_reg_curpm. So we just need a single global (per interpreter) placeholder. Since we're shortly going to get rid of PL_reg_state, we need to move it out of that struct. --- regexp.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'regexp.h') diff --git a/regexp.h b/regexp.h index 01c8f36616..bd3aeb66b7 100644 --- a/regexp.h +++ b/regexp.h @@ -828,11 +828,9 @@ typedef struct regmatch_slab { struct regmatch_slab *prev, *next; } regmatch_slab; -#define PL_reg_curpm PL_reg_state.re_state_reg_curpm #define PL_reg_starttry PL_reg_state.re_state_reg_starttry struct re_save_state { - PMOP *re_state_reg_curpm; /* from regexec.c */ char *re_state_reg_starttry; /* from regexec.c */ }; -- cgit v1.2.1