mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-09-29 19:24:25 +03:00
ng: check can_never_match before validate_fuzzy
This commit is contained in:
committed by
Matthew Barr
parent
c50a931bb4
commit
5edecbf539
@@ -330,6 +330,10 @@ bool NG::addGraph(NGWrapper &w) {
|
||||
/* ensure utf8 starts at cp boundary */
|
||||
ensureCodePointStart(rm, w);
|
||||
|
||||
if (can_never_match(w)) {
|
||||
throw CompileError(w.expressionIndex, "Pattern can never match.");
|
||||
}
|
||||
|
||||
// validate graph's suitability for fuzzing before resolving asserts
|
||||
validate_fuzzy_compile(w, w.edit_distance, w.utf8, cc.grey);
|
||||
|
||||
|
Reference in New Issue
Block a user