]> git.vpit.fr Git - perl/modules/re-engine-Hooks.git/blobdiff - src/update.pl
Attach the callbacks to every regexps in a thread-safe way
[perl/modules/re-engine-Hooks.git] / src / update.pl
index 0517d37462d41b44d90fc06c05034db66a7c3925..53836074173c9ee5dff477bb602bbd77427f60f1 100644 (file)
@@ -221,6 +221,8 @@ sub patch_regcomp {
 
  if ($line =~ /#\s*include\s+"INTERN\.h"/) {
   return "#include \"re_defs.h\"\n";
+ } elsif ($line =~ /^(\s*)RExC_rxi\s*=\s*ri\s*;\s*$/) {
+  return $line, "$1REH_CALL_COMP_BEGIN_HOOK(pRExC_state->rx);\n";
  } elsif ($line =~ /FILL_ADVANCE_NODE(_ARG)?\(\s*([^\s,\)]+)/) {
   my $shift = $1 ? 2 : 1;
   return $line, "    REH_CALL_REGCOMP_HOOK(pRExC_state->rx, ($2) - $shift);\n"