diff options
author | Neil <nyamatongwe@gmail.com> | 2021-05-28 14:46:21 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-05-28 14:46:21 +1000 |
commit | c9b2423aaed459c68dd8f43b1de0edee4eb287c8 (patch) | |
tree | f9bfdfa908e5a0a242fb2a00f1ed988682f568c5 /src/CaseConvert.cxx | |
parent | a20684909b6edadae8e0c8c9ebc0d15d7fc128ba (diff) | |
download | scintilla-mirror-c9b2423aaed459c68dd8f43b1de0edee4eb287c8.tar.gz |
Better exception handling for noexcept methods. More accurate noexcept marking.
Diffstat (limited to 'src/CaseConvert.cxx')
-rw-r--r-- | src/CaseConvert.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/CaseConvert.cxx b/src/CaseConvert.cxx index 03dbce4e9..fd1bee2c9 100644 --- a/src/CaseConvert.cxx +++ b/src/CaseConvert.cxx @@ -588,7 +588,13 @@ class CaseConverter : public ICaseConverter { } CharacterConversion(int character_, std::string_view conversion_) noexcept : character(character_) { assert(conversion_.length() <= maxConversionLength); - conversion_.copy(conversion.conversion, conversion_.length()); + try { + // This can never fail as std::string_view::copy should only throw + // std::out_of_range if pos > size() and pos == 0 here + conversion_.copy(conversion.conversion, conversion_.length()); + } catch (...) { + // Ignore any exception + } } bool operator<(const CharacterConversion &other) const noexcept { return character < other.character; |