12 Star 0 Fork 34

src-openEuler/pcre2

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Fix-an-invalid-match-of-ascii-word-classes-when-inva.patch 1.60 KB
一键复制 编辑 原始数据 按行查看 历史
Mingtai 提交于 2023-06-26 22:19 . sync community patchs
From 2c08b619dc973beacc474dcb67cda8cd366200ce Mon Sep 17 00:00:00 2001
From: Zoltan Herczeg <hzmester@freemail.hu>
Date: Tue, 11 Apr 2023 12:42:11 +0000
Subject: [PATCH] Fix an invalid match of ascii word classes when invalid utf
is enabled
Fixes #224
Conflict:delete changelog
Reference:https://github.com/PCRE2Project/pcre2/commit/2c08b619dc973beacc474dcb67cda8cd366200ce
---
src/pcre2_jit_compile.c | 1 +
src/pcre2_jit_test.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c
index 75ba610..81b7a93 100644
--- a/src/pcre2_jit_compile.c
+++ b/src/pcre2_jit_compile.c
@@ -4132,6 +4132,7 @@ if (negated)
if (common->invalid_utf)
{
+ OP1(SLJIT_MOV, TMP1, 0, TMP2, 0);
add_jump(compiler, &common->utfreadchar_invalid, JUMP(SLJIT_FAST_CALL));
add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, INVALID_UTF_CHAR));
OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0);
diff --git a/src/pcre2_jit_test.c b/src/pcre2_jit_test.c
index e1f0bbc..1a1f6c5 100644
--- a/src/pcre2_jit_test.c
+++ b/src/pcre2_jit_test.c
@@ -1979,6 +1979,7 @@ static const struct invalid_utf8_regression_test_case invalid_utf8_regression_te
{ PCRE2_UTF, CI, 0, 0, 0, 7, 11, { "#\xc7\x85#", NULL }, "\x80\x80#\xc7\x80\x80\x80#\xc7\x85#" },
{ PCRE2_UTF | PCRE2_UCP, CI, 0, 0, 0, -1, -1, { "[\\s]", NULL }, "\xed\xa0\x80" },
+ { PCRE2_UTF, CI, 0, 0, 0, 1, 4, { "[\\D]", NULL }, "@\xe0\xab\xaa@" },
/* These two are not invalid UTF tests, but this infrastructure fits better for them. */
{ 0, PCRE2_JIT_COMPLETE, 0, 0, 1, -1, -1, { "\\X{2}", NULL }, "\r\n\n" },
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/pcre2.git
git@gitee.com:src-openeuler/pcre2.git
src-openeuler
pcre2
pcre2
master

搜索帮助