From bf0d793b562c409c3aa940e6ffeeabd655dd49e5 Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Wed, 25 Jan 2023 09:15:26 +0100 Subject: regcomp.c - Use RXp_OFFSp() to access offset data This insulates access to the regexp match offset data so we can fix the define later and move the offset structure into a new struct. The RXp_OFFSp() was introduced in a recent commit to deliberately break anything using RXp_OFFS() directly. It is hard to type deliberately, nothing but the internals should use it. Everything else should use one of the wrappers around it. --- dump.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'dump.c') diff --git a/dump.c b/dump.c index edbeb182b8..a0b34e15f9 100644 --- a/dump.c +++ b/dump.c @@ -2683,8 +2683,8 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo Perl_dump_indent(aTHX_ level, file, " PPRIVATE = 0x%" UVxf "\n", PTR2UV(r->pprivate)); Perl_dump_indent(aTHX_ level, file, " OFFS = 0x%" UVxf "\n", - PTR2UV(r->offs)); - if (r->offs) { + PTR2UV(RXp_OFFSp(r))); + if (RXp_OFFSp(r)) { U32 n; sv_setpvs(d,"[ "); /* note offs[0] is for the whole match, and @@ -2692,7 +2692,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo * show one more than we have nparens. */ for(n = 0; n <= r->nparens; n++) { sv_catpvf(d,"%" IVdf ":%" IVdf "%s", - (IV)(r->offs[n].start), (IV)(r->offs[n].end), + (IV)RXp_OFFSp(r)[n].start, (IV)RXp_OFFSp(r)[n].end, n+1 > r->nparens ? " ]\n" : ", "); } Perl_dump_indent(aTHX_ level, file, " %" SVf, d); -- cgit v1.2.1