]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
Make vectorscan accept \0 starting pattern (#312)
authorypicchi-arm <67330153+ypicchi-arm@users.noreply.github.com>
Thu, 22 Aug 2024 07:32:53 +0000 (08:32 +0100)
committerGitHub <noreply@github.com>
Thu, 22 Aug 2024 07:32:53 +0000 (10:32 +0300)
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 <yoan.picchi@arm.com>
src/compiler/compiler.cpp

index aa8de4ba2c02514097779b8be2d8612d452ab4be..ec9295c985b16eb250d9035cb513e1a583e05614 100644 (file)
@@ -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.");
     }