From cef180f6b21c945e9113e5316ca06589c827bc10 Mon Sep 17 00:00:00 2001 From: Alexey Toptygin Date: Thu, 27 Oct 2022 04:06:57 -0700 Subject: [PATCH] Publish PREG_JIT_STACKLIMIT_ERROR in hhi and use it in the HSL Reviewed By: DavidSnider Differential Revision: D39677047 fbshipit-source-id: bf89d8c32b24e41c0682e9976dd94e10eb92ba1c --- hphp/hack/hhi/stdlib/builtins_preg.hhi | 1 + hphp/hsl/src/regex/exception.php | 1 + 2 files changed, 2 insertions(+) diff --git a/hphp/hack/hhi/stdlib/builtins_preg.hhi b/hphp/hack/hhi/stdlib/builtins_preg.hhi index 219c2003eb2ac..cbbe9a9d560bb 100644 --- a/hphp/hack/hhi/stdlib/builtins_preg.hhi +++ b/hphp/hack/hhi/stdlib/builtins_preg.hhi @@ -160,6 +160,7 @@ const int PREG_RECURSION_LIMIT_ERROR = 0; const int PREG_BAD_UTF8_ERROR = 0; const int PREG_BAD_UTF8_OFFSET_ERROR = 0; const int PREG_BAD_REGEX_ERROR = 0; +const int PREG_JIT_STACKLIMIT_ERROR = 0; const int PREG_GREP_INVERT = 0; const string PCRE_VERSION = ''; diff --git a/hphp/hsl/src/regex/exception.php b/hphp/hsl/src/regex/exception.php index b74240d8f3076..ce1d70eb2267d 100644 --- a/hphp/hsl/src/regex/exception.php +++ b/hphp/hsl/src/regex/exception.php @@ -21,6 +21,7 @@ public function __construct(Pattern $pattern, int $code)[] { \PREG_BAD_UTF8_ERROR => 'Bad UTF8 error', \PREG_BAD_UTF8_OFFSET_ERROR => 'Bad UTF8 offset error', \PREG_BAD_REGEX_ERROR => 'Regex failed to compile', + \PREG_JIT_STACKLIMIT_ERROR => 'PCRE JIT stack limit error', ]; parent::__construct( Str\format(