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:
parent
8ba5a06379
commit
5d7e44a3cd
@ -625,6 +625,7 @@ namespace stdex
|
|||||||
_In_ size_t end = SIZE_MAX,
|
_In_ size_t end = SIZE_MAX,
|
||||||
_In_ int flags = match_default)
|
_In_ int flags = match_default)
|
||||||
{
|
{
|
||||||
|
_Assume_(text || !end);
|
||||||
_Assume_(text || start >= end);
|
_Assume_(text || start >= end);
|
||||||
bool r = start == 0 || (start <= end && stdex::islbreak(text[start - 1]));
|
bool r = start == 0 || (start <= end && stdex::islbreak(text[start - 1]));
|
||||||
if ((r && !m_invert) || (!r && m_invert)) {
|
if ((r && !m_invert) || (!r && m_invert)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user