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 <yoan.picchi@arm.com>
This commit is contained in:
ypicchi-arm 2024-08-22 08:32:53 +01:00 committed by GitHub
parent aa4bc24439
commit e4c49f2aa2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View 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.");
}