LazUtils: Masks: an empty negated set is also an empty set, so don't allow that as well.

This commit is contained in:
Bart 2021-10-31 16:19:49 +01:00
parent 20f3e55048
commit 0a32776e98

View File

@ -785,7 +785,7 @@ begin
fLastOC:=TMaskParsedCode.Range;
end else if fMask[fMaskInd]=']' then begin
if fLastOC=TMaskParsedCode.CharsGroupBegin then
if (fLastOC=TMaskParsedCode.CharsGroupBegin) or (fLastOC=TMaskParsedCode.Negate) then
Exception_InvalidCharMask(fMask[fMaskInd],fMaskInd); //Error empty match
// Insert the new offset in case of a positive match in CharsGroup
PInteger(@fMaskCompiled[lCharsGroupInsertSize])^:=fMaskCompiledIndex;