Skip to content

Commit ea4bb21

Browse files
committed
Insert omitted setting of subject length at the end of pcre2_jit_match()
1 parent 78b7c5b commit ea4bb21

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ all of a, b, and d as possible starting code units; now it sets only a and d.
200200
55. In pcre2test, ensure pcre2_jit_match() is used when jitfast is used with
201201
substitution testing.
202202

203+
56. Insert omitted setting of subject length in match data at the end of
204+
pcre2_jit_match().
205+
203206

204207
Version 10.42 11-December-2022
205208
------------------------------

src/pcre2_jit_match.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
77
88
Written by Philip Hazel
99
Original API code Copyright (c) 1997-2012 University of Cambridge
10-
New API code Copyright (c) 2016-2018 University of Cambridge
10+
New API code Copyright (c) 2016-2023 University of Cambridge
1111
1212
-----------------------------------------------------------------------------
1313
Redistribution and use in source and binary forms, with or without
@@ -171,6 +171,7 @@ if (rc > (int)oveccount)
171171
rc = 0;
172172
match_data->code = re;
173173
match_data->subject = (rc >= 0 || rc == PCRE2_ERROR_PARTIAL)? subject : NULL;
174+
match_data->subject_length = length;
174175
match_data->rc = rc;
175176
match_data->startchar = arguments.startchar_ptr - subject;
176177
match_data->leftchar = 0;

testdata/testinput17

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,4 +310,7 @@
310310
/(.)(.)/jitfast,replace=$2+$1
311311
ABCD
312312

313+
/(...)-(...)/jitfast
314+
abc-xyz\=get=2
315+
313316
# End of testinput17

testdata/testoutput17

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,4 +558,11 @@ Failed: error -47: match limit exceeded
558558
ABCD
559559
1: B+ACD
560560

561+
/(...)-(...)/jitfast
562+
abc-xyz\=get=2
563+
0: abc-xyz (JIT)
564+
1: abc
565+
2: xyz
566+
2G xyz (3)
567+
561568
# End of testinput17

0 commit comments

Comments
 (0)