Skip to content

Commit

Permalink
Reserve another bit in the regex extflags.
Browse files Browse the repository at this point in the history
This breaks binary compatibility, but that's fine in blead.
  • Loading branch information
nwc10 authored and khwilliamson committed Jun 6, 2021
1 parent e9061b9 commit f6f1a03
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 24 deletions.
15 changes: 11 additions & 4 deletions ext/Devel-Peek/t/Peek.t
Expand Up @@ -355,9 +355,10 @@ do_test('reference to named subroutine without prototype',

if ($] >= 5.011) {
# note the conditionals on ENGINE and INTFLAGS were introduced in 5.19.9
do_test('reference to regexp',
qr(tic),
'SV = $RV\\($ADDR\\) at $ADDR
# We are taking great care to curate this test as if the module is dual life
# (or we actively want to cherry-pick entire chunks of it back to maint)
# Is this a good idea?
my $raw = 'SV = $RV\\($ADDR\\) at $ADDR
REFCNT = 1
FLAGS = \\(ROK\\)
RV = $ADDR
Expand Down Expand Up @@ -423,7 +424,13 @@ do_test('reference to regexp',
OFFS = $ADDR
QR_ANONCV = 0x0(?:
SAVED_COPY = 0x0)?'
));
);

$raw =~ s/ EXTFLAGS = 0x680000 / EXTFLAGS = 0x340000 /g
if $] >= 5.035;
do_test('reference to regexp',
qr(tic),
$raw);
} else {
do_test('reference to regexp',
qr(tic),
Expand Down
4 changes: 2 additions & 2 deletions regexp.h
Expand Up @@ -414,7 +414,7 @@ and check for NULL.
* For the regexp bits, PL_reg_extflags_name[] in regnodes.h has a comment
* giving which bits are used/unused */

# define RXf_BASE_SHIFT (_RXf_PMf_SHIFT_NEXT + 2)
# define RXf_BASE_SHIFT (_RXf_PMf_SHIFT_NEXT + 1)

/* What we have seen */
# define RXf_NO_INPLACE_SUBST (1U<<(RXf_BASE_SHIFT+2))
Expand Down Expand Up @@ -455,7 +455,7 @@ and check for NULL.
* highest bit position should be used, so that if RXf_BASE_SHIFT gets
* increased, the #error below will be triggered so that you will be reminded
* to adjust things at the other end to keep the bit positions unchanged */
# if RXf_BASE_SHIFT+17 > 31
# if RXf_BASE_SHIFT+18 > 31
# error Too many RXf_PMf bits used. See comments at beginning of these for what to do
# endif

Expand Down
36 changes: 18 additions & 18 deletions regnodes.h
Expand Up @@ -1654,7 +1654,7 @@ EXTCONST char * const PL_reg_name[] = {
EXTCONST char * PL_reg_extflags_name[];
#else
EXTCONST char * const PL_reg_extflags_name[] = {
/* Bits in extflags defined: 11111111111111110000111111111111 */
/* Bits in extflags defined: 01111111111111111000111111111111 */
"MULTILINE", /* 0x00000001 */
"SINGLELINE", /* 0x00000002 */
"FOLD", /* 0x00000004 */
Expand All @@ -1670,23 +1670,23 @@ EXTCONST char * const PL_reg_extflags_name[] = {
"UNUSED_BIT_12", /* 0x00001000 */
"UNUSED_BIT_13", /* 0x00002000 */
"UNUSED_BIT_14", /* 0x00004000 */
"UNUSED_BIT_15", /* 0x00008000 */
"NO_INPLACE_SUBST", /* 0x00010000 */
"EVAL_SEEN", /* 0x00020000 */
"UNBOUNDED_QUANTIFIER_SEEN",/* 0x00040000 */
"CHECK_ALL", /* 0x00080000 */
"MATCH_UTF8", /* 0x00100000 */
"USE_INTUIT_NOML", /* 0x00200000 */
"USE_INTUIT_ML", /* 0x00400000 */
"INTUIT_TAIL", /* 0x00800000 */
"IS_ANCHORED", /* 0x01000000 */
"COPY_DONE", /* 0x02000000 */
"TAINTED_SEEN", /* 0x04000000 */
"TAINTED", /* 0x08000000 */
"START_ONLY", /* 0x10000000 */
"SKIPWHITE", /* 0x20000000 */
"WHITE", /* 0x40000000 */
"NULL", /* 0x80000000 */
"NO_INPLACE_SUBST", /* 0x00008000 */
"EVAL_SEEN", /* 0x00010000 */
"UNBOUNDED_QUANTIFIER_SEEN",/* 0x00020000 */
"CHECK_ALL", /* 0x00040000 */
"MATCH_UTF8", /* 0x00080000 */
"USE_INTUIT_NOML", /* 0x00100000 */
"USE_INTUIT_ML", /* 0x00200000 */
"INTUIT_TAIL", /* 0x00400000 */
"IS_ANCHORED", /* 0x00800000 */
"COPY_DONE", /* 0x01000000 */
"TAINTED_SEEN", /* 0x02000000 */
"TAINTED", /* 0x04000000 */
"START_ONLY", /* 0x08000000 */
"SKIPWHITE", /* 0x10000000 */
"WHITE", /* 0x20000000 */
"NULL", /* 0x40000000 */
"UNUSED_BIT_31", /* 0x80000000 */
};
#endif /* DOINIT */

Expand Down

0 comments on commit f6f1a03

Please sign in to comment.