Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error handling for SmallVector programming errors
This patch changes errors in `SmallVector::grow` that are independent of memory capacity to be reported using report_fatal_error or std::length_error instead of report_bad_alloc_error, which falsely signals an OOM. It also cleans up a few related things: - makes report_bad_alloc_error to print the failure reason passed to it. - fixes the documentation to indicate that report_bad_alloc_error calls `abort()` not "an assertion" - uses a consistent name for the size/capacity argument to `grow` and `grow_pod` Reviewed By: mehdi_amini, MaskRay Differential Revision: https://reviews.llvm.org/D86892
- Loading branch information
1 parent
1284dc3
commit 848b0e2
Showing
4 changed files
with
56 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters