Skip to content

Commit

Permalink
Insert omitted setting of subject length at the end of pcre2_jit_match()
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipHazel committed Dec 29, 2023
1 parent 78b7c5b commit ea4bb21
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ all of a, b, and d as possible starting code units; now it sets only a and d.
55. In pcre2test, ensure pcre2_jit_match() is used when jitfast is used with
substitution testing.

56. Insert omitted setting of subject length in match data at the end of
pcre2_jit_match().


Version 10.42 11-December-2022
------------------------------
Expand Down
3 changes: 2 additions & 1 deletion src/pcre2_jit_match.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
New API code Copyright (c) 2016-2018 University of Cambridge
New API code Copyright (c) 2016-2023 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -171,6 +171,7 @@ if (rc > (int)oveccount)
rc = 0;
match_data->code = re;
match_data->subject = (rc >= 0 || rc == PCRE2_ERROR_PARTIAL)? subject : NULL;
match_data->subject_length = length;
match_data->rc = rc;
match_data->startchar = arguments.startchar_ptr - subject;
match_data->leftchar = 0;
Expand Down
3 changes: 3 additions & 0 deletions testdata/testinput17
Original file line number Diff line number Diff line change
Expand Up @@ -310,4 +310,7 @@
/(.)(.)/jitfast,replace=$2+$1
ABCD

/(...)-(...)/jitfast
abc-xyz\=get=2

# End of testinput17
7 changes: 7 additions & 0 deletions testdata/testoutput17
Original file line number Diff line number Diff line change
Expand Up @@ -558,4 +558,11 @@ Failed: error -47: match limit exceeded
ABCD
1: B+ACD

/(...)-(...)/jitfast
abc-xyz\=get=2
0: abc-xyz (JIT)
1: abc
2: xyz
2G xyz (3)

# End of testinput17

0 comments on commit ea4bb21

Please sign in to comment.