parser: address Code Analysis warning

Nice catch: when calling with basic_bol::match(nullptr, 5, 5), the
method addresses null[4].

Turned this condition into debug assert, as (nullptr, 5, 5) is invalid
input parameter combination.
This commit is contained in:
Simon Rozman 2023-12-08 14:20:56 +01:00
parent 8ba5a06379
commit 5d7e44a3cd

View File

@ -625,6 +625,7 @@ namespace stdex
_In_ size_t end = SIZE_MAX,
_In_ int flags = match_default)
{
_Assume_(text || !end);
_Assume_(text || start >= end);
bool r = start == 0 || (start <= end && stdex::islbreak(text[start - 1]));
if ((r && !m_invert) || (!r && m_invert)) {