From e4c49f2aa263a577d8beb57f7958fb889bfa53db Mon Sep 17 00:00:00 2001 From: ypicchi-arm <67330153+ypicchi-arm@users.noreply.github.com> Date: Thu, 22 Aug 2024 08:32:53 +0100 Subject: [PATCH] Make vectorscan accept \0 starting pattern (#312) Vectorscan used to reject such pattern because they were being compared to "" and found to be an empty string. We now check the pattern length instead. Signed-off-by: Yoan Picchi --- src/compiler/compiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/compiler.cpp b/src/compiler/compiler.cpp index aa8de4ba..ec9295c9 100644 --- a/src/compiler/compiler.cpp +++ b/src/compiler/compiler.cpp @@ -417,7 +417,7 @@ void addLitExpression(NG &ng, unsigned index, const char *expression, "HS_FLAG_SOM_LEFTMOST are supported in literal API."); } - if (!strcmp(expression, "")) { + if (expLength == 0) { throw CompileError("Pure literal API doesn't support empty string."); }