@@ -267,6 +267,7 @@ bool Value::CZString::operator<(const CZString& other) const {
267
267
unsigned this_len = this ->storage_ .length_ ;
268
268
unsigned other_len = other.storage_ .length_ ;
269
269
unsigned min_len = std::min (this_len, other_len);
270
+ JSON_ASSERT (this ->cstr_ && other.cstr_ );
270
271
int comp = memcmp (this ->cstr_ , other.cstr_ , min_len);
271
272
if (comp < 0 ) return true ;
272
273
if (comp > 0 ) return false ;
@@ -280,6 +281,7 @@ bool Value::CZString::operator==(const CZString& other) const {
280
281
unsigned this_len = this ->storage_ .length_ ;
281
282
unsigned other_len = other.storage_ .length_ ;
282
283
if (this_len != other_len) return false ;
284
+ JSON_ASSERT (this ->cstr_ && other.cstr_ );
283
285
int comp = memcmp (this ->cstr_ , other.cstr_ , this_len);
284
286
return comp == 0 ;
285
287
}
@@ -525,6 +527,7 @@ bool Value::operator<(const Value& other) const {
525
527
decodePrefixedString (this ->allocated_ , this ->value_ .string_ , &this_len, &this_str);
526
528
decodePrefixedString (other.allocated_ , other.value_ .string_ , &other_len, &other_str);
527
529
unsigned min_len = std::min (this_len, other_len);
530
+ JSON_ASSERT (this_str && other_str);
528
531
int comp = memcmp (this_str, other_str, min_len);
529
532
if (comp < 0 ) return true ;
530
533
if (comp > 0 ) return false ;
@@ -580,6 +583,7 @@ bool Value::operator==(const Value& other) const {
580
583
decodePrefixedString (this ->allocated_ , this ->value_ .string_ , &this_len, &this_str);
581
584
decodePrefixedString (other.allocated_ , other.value_ .string_ , &other_len, &other_str);
582
585
if (this_len != other_len) return false ;
586
+ JSON_ASSERT (this_str && other_str);
583
587
int comp = memcmp (this_str, other_str, this_len);
584
588
return comp == 0 ;
585
589
}
@@ -914,7 +918,7 @@ void Value::resize(ArrayIndex newSize) {
914
918
for (ArrayIndex index = newSize; index < oldSize; ++index ) {
915
919
value_.map_ ->erase (index );
916
920
}
917
- assert (size () == newSize);
921
+ JSON_ASSERT (size () == newSize);
918
922
}
919
923
}
920
924
0 commit comments