From 5c69c3c9e29f1bf73e2ba8e32411028bae9e1ac5 Mon Sep 17 00:00:00 2001 From: sanish-bruno Date: Fri, 20 Jun 2025 13:08:51 +0530 Subject: [PATCH] regexp: allow [\-] in unicode mode --- vendor/quickjs/libregexp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vendor/quickjs/libregexp.c b/vendor/quickjs/libregexp.c index a2d56a7d..2b2422ce 100644 --- a/vendor/quickjs/libregexp.c +++ b/vendor/quickjs/libregexp.c @@ -683,6 +683,10 @@ static int get_class_atom(REParseState *s, CharRange *cr, c = '\\'; } break; + case '-': + if (!inclass && s->is_unicode) + goto invalid_escape; + break; #ifdef CONFIG_ALL_UNICODE case 'p': case 'P':