From 9589ee9f90a62136018ea027ea01aaa4a38a6d38 Mon Sep 17 00:00:00 2001 From: Justin Viiret Date: Mon, 5 Jun 2017 14:38:57 +1000 Subject: [PATCH] hs_expression_info: check unsupported constructs --- src/hs.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/hs.cpp b/src/hs.cpp index b93a56ee..33459347 100644 --- a/src/hs.cpp +++ b/src/hs.cpp @@ -44,6 +44,7 @@ #include "parser/parse_error.h" #include "parser/Parser.h" #include "parser/prefilter.h" +#include "parser/unsupported.h" #include "util/compile_error.h" #include "util/cpuid_flags.h" #include "util/depth.h" @@ -376,6 +377,14 @@ hs_error_t hs_expression_info_int(const char *expression, unsigned int flags, prefilterTree(pe.component, ParseMode(flags)); } + // Expressions containing zero-width assertions and other extended pcre + // types aren't supported yet. This call will throw a ParseError + // exception if the component tree contains such a construct. + checkUnsupported(*pe.component); + + pe.component->checkEmbeddedStartAnchor(true); + pe.component->checkEmbeddedEndAnchor(true); + auto built_expr = buildGraph(rm, cc, pe); unique_ptr &g = built_expr.g; ExpressionInfo &expr = built_expr.expr;