$pattern =~ s/\$RV/
($] < 5.011) ? 'RV' : 'IV';
/mge;
+ $pattern =~ s/^\h+COW_REFCNT = \d+\h*\n//mg
+ if $Config{ccflags} =~
+ /-DPERL_(?:OLD_COPY_ON_WRITE|NO_COW)/;
print $pattern, "\n" if $DEBUG;
my ($dump, $dump2) = split m/\*\*\*\*\*\n/, scalar <IN>;
NV = 0
PV = $ADDR ""\\\0
CUR = 0
- LEN = \d+(?:
- COW_REFCNT = 1)?
+ LEN = \d+
+ COW_REFCNT = 1
MAGIC = $ADDR
MG_VIRTUAL = &PL_vtbl_mglob
MG_TYPE = PERL_MAGIC_regex_global\\(g\\)
do_test('regular string constant', perl,
'SV = PV\\($ADDR\\) at $ADDR
REFCNT = 5
- FLAGS = \\(PADMY,POK,READONLY,pPOK\\) # $] < 5.019003
- FLAGS = \\(PADMY,POK,READONLY,IsCOW,pPOK\\) # $] >=5.019003
+ FLAGS = \\(PADMY,POK,READONLY,(?:IsCOW,)?pPOK\\)
PV = $ADDR "rules"\\\0
CUR = 5
LEN = \d+
do_test('string constant now an FBM', perl,
'SV = PVMG\\($ADDR\\) at $ADDR
REFCNT = 5
- FLAGS = \\(PADMY,SMG,POK,READONLY,pPOK,VALID,EVALED\\) # $] < 5.019003
- FLAGS = \\(PADMY,SMG,POK,READONLY,IsCOW,pPOK,VALID,EVALED\\) # $] >=5.019003
+ FLAGS = \\(PADMY,SMG,POK,READONLY,(?:IsCOW,)?pPOK,VALID,EVALED\\)
PV = $ADDR "rules"\\\0
CUR = 5
LEN = \d+
do_test('string constant still an FBM', perl,
'SV = PVMG\\($ADDR\\) at $ADDR
REFCNT = 5
- FLAGS = \\(PADMY,SMG,POK,READONLY,pPOK,VALID,EVALED\\) # $] < 5.019003
- FLAGS = \\(PADMY,SMG,POK,READONLY,IsCOW,pPOK,VALID,EVALED\\) # $] >=5.019003
+ FLAGS = \\(PADMY,SMG,POK,READONLY,(?:IsCOW,)?pPOK,VALID,EVALED\\)
PV = $ADDR "rules"\\\0
CUR = 5
LEN = \d+
do_test('regular string constant', beer,
'SV = PV\\($ADDR\\) at $ADDR
REFCNT = 6
- FLAGS = \\(PADMY,POK,READONLY,pPOK\\) # $] < 5.019003
- FLAGS = \\(PADMY,POK,READONLY,IsCOW,pPOK\\) # $] >=5.019003
+ FLAGS = \\(PADMY,POK,READONLY,(?:IsCOW,)?pPOK\\)
PV = $ADDR "foamy"\\\0
CUR = 5
LEN = \d+
do_test('string constant quite unaffected', beer, 'SV = PV\\($ADDR\\) at $ADDR
REFCNT = 6
- FLAGS = \\(PADMY,POK,READONLY,pPOK\\) # $] < 5.019003
- FLAGS = \\(PADMY,POK,READONLY,IsCOW,pPOK\\) # $] >=5.019003
+ FLAGS = \\(PADMY,POK,READONLY,(?:IsCOW,)?pPOK\\)
PV = $ADDR "foamy"\\\0
CUR = 5
LEN = \d+
my $want = 'SV = PVMG\\($ADDR\\) at $ADDR
REFCNT = 6
- FLAGS = \\(PADMY,SMG,POK,READONLY,pPOK,VALID,EVALED\\) # $] < 5.019003
- FLAGS = \\(PADMY,SMG,POK,READONLY,IsCOW,pPOK,VALID,EVALED\\) # $] >=5.019003
+ FLAGS = \\(PADMY,SMG,POK,READONLY,(?:IsCOW,)?pPOK,VALID,EVALED\\)
PV = $ADDR "foamy"\\\0
CUR = 5
LEN = \d+