@@ -336,14 +336,16 @@ from_chars_float_advanced(UC const *first, UC const *last, T &value,
336336 ++first;
337337 }
338338 }
339+ #endif
340+ #ifdef FASTFLOAT_ISNOT_CHECKED_BOUNDS
341+ // We are in parser code with external loop that checks bounds.
342+ FASTFLOAT_ASSUME (first < last);
343+ #else
339344 if (first == last) {
340345 answer.ec = std::errc::invalid_argument;
341346 answer.ptr = first;
342347 return answer;
343348 }
344- #else
345- // We are in parser code with external loop that checks bounds.
346- FASTFLOAT_ASSUME (first < last);
347349#endif
348350 parsed_number_string_t <UC> const pns =
349351#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
@@ -498,19 +500,19 @@ from_chars_int_advanced(UC const *first, UC const *last, T &value,
498500 static_assert (is_supported_char_type<UC>::value,
499501 " only char, wchar_t, char16_t and char32_t are supported" );
500502
501- #ifdef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
502- // We are in parser code with external loop that checks bounds.
503- FASTFLOAT_ASSUME (first < last);
504- // base is already checked in the parse_options_t constructor.
505- #else
503+ #ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
506504 if (chars_format_t (options.format & chars_format::skip_white_space)) {
507505 while ((first != last) && fast_float::is_space (*first)) {
508506 ++first;
509507 }
510508 }
509+ #endif
510+ #ifdef FASTFLOAT_ISNOT_CHECKED_BOUNDS
511+ // We are in parser code with external loop that checks bounds.
512+ FASTFLOAT_ASSUME (first < last);
511513#endif
512514 if (
513- #ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
515+ #ifndef FASTFLOAT_ISNOT_CHECKED_BOUNDS
514516 first == last ||
515517#endif
516518 options.base < 2 || options.base > 36 ) {
0 commit comments