mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 8.0.0645: no error for illegal back reference in NFA engine
Problem: The new regexp engine does not give an error for using a back reference where it is not allowed. (Dominique Pelle) Solution: Check the back reference like the old engine. (closes #1774)
This commit is contained in:
@@ -1446,8 +1446,14 @@ nfa_regatom(void)
|
||||
case Magic('7'):
|
||||
case Magic('8'):
|
||||
case Magic('9'):
|
||||
EMIT(NFA_BACKREF1 + (no_Magic(c) - '1'));
|
||||
nfa_has_backref = TRUE;
|
||||
{
|
||||
int refnum = no_Magic(c) - '1';
|
||||
|
||||
if (!seen_endbrace(refnum + 1))
|
||||
return FAIL;
|
||||
EMIT(NFA_BACKREF1 + refnum);
|
||||
nfa_has_backref = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case Magic('z'):
|
||||
|
Reference in New Issue
Block a user