Skip to content

Commit a45e444

Browse files
committed
add back in comments from the pcre plugin
1 parent a6b287f commit a45e444

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plugins/regex_remap/regex_remap.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@
5050
static const char *PLUGIN_NAME = "regex_remap";
5151

5252
// Constants
53-
static const int MATCHCOUNT = 15;
54-
static const int MAX_SUBS = 32; // No more than 32 substitution variables in the subst string
53+
static const int MATCHCOUNT = 15; // We support $0 - $9 x2 ints, and this needs to be 1.5x that
54+
static const int MAX_SUBS = 32; // No more than 32 substitution variables in the subst string
55+
static const int32_t REGEX_MATCH_LIMIT = 1750; // POOMA - also dependent on actual stack size. Crashes with previous value of 2047
5556

5657
// Substitutions other than regex matches
5758
enum ExtraSubstitutions {
@@ -791,7 +792,7 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char * /* errbuf ATS_UNUSE
791792
}
792793
}
793794

794-
ri->match_context.setMatchLimit(1750);
795+
ri->match_context.setMatchLimit(REGEX_MATCH_LIMIT);
795796

796797
// Make sure we got something...
797798
if (ri->first == nullptr) {

0 commit comments

Comments
 (0)