[base] CHECK_LE(pos, size()) in BasicStringPiece::substr
This change adds a CHECK_LE(pos, size()) in BasicStringPiece::substr. This attempts to model standard library behavior, since std::basic_string_view::substr throws an out_of_range exception in this case. Reference: https://wg21.link/string.view.ops#itemdecl:2 TBR=dcheng Bug: 1049498 Change-Id: Ie5c946b8cd1b2cb9d7022bfcd5fa2a89372ec31c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2372445 Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org> Reviewed-by:Daniel Cheng <dcheng@chromium.org> Cr-Commit-Position: refs/heads/master@{#802440}
Showing
Please register or sign in to comment