From e9e6bce80a7a33924742cc3f9373accb26ea0c4b Mon Sep 17 00:00:00 2001 From: Rasmus Lerchedahl Petersen Date: Wed, 16 Aug 2023 11:49:23 +0200 Subject: [PATCH] shared: handle empty groups in delta --- shared/regex/codeql/regex/nfa/NfaUtils.qll | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shared/regex/codeql/regex/nfa/NfaUtils.qll b/shared/regex/codeql/regex/nfa/NfaUtils.qll index a951820bda1..2b14fe28aca 100644 --- a/shared/regex/codeql/regex/nfa/NfaUtils.qll +++ b/shared/regex/codeql/regex/nfa/NfaUtils.qll @@ -760,6 +760,12 @@ module Make { or exists(RegExpGroup grp | lbl = Epsilon() | q1 = before(grp) and q2 = before(grp.getChild(0))) or + exists(RegExpGroup grp | lbl = Epsilon() | + not exists(grp.getAChild()) and + q1 = before(grp) and + q2 = before(grp.getSuccessor()) + ) + or exists(EffectivelyStar star | lbl = Epsilon() | q1 = before(star) and q2 = before(star.getChild(0)) or