From 20a259cfaad77a41c9d2eb3db5c4a68377a52356 Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Fri, 3 Sep 2021 10:40:08 -0700 Subject: [PATCH] throw less #5519 --- src/util/zstring.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/util/zstring.cpp b/src/util/zstring.cpp index 46c9d9fce..a0a5764bd 100644 --- a/src/util/zstring.cpp +++ b/src/util/zstring.cpp @@ -43,9 +43,9 @@ bool zstring::is_escape_char(char const *& s, unsigned& result) { } else if (*(s+3+i) == '}') { if (result > 255 && !uses_unicode()) - throw default_exception("unicode characters outside of byte range are not supported"); - if (result > unicode_max_char()) - throw default_exception("unicode characters outside of byte range are not supported"); + return false; + if (result > unicode_max_char()) + return false; s += 4 + i; return true; } @@ -65,8 +65,8 @@ bool zstring::is_escape_char(char const *& s, unsigned& result) { result = 16*result + d2; result = 16*result + d3; result = 16*result + d4; - if (result > unicode_max_char()) - throw default_exception("unicode characters outside of byte range are not supported"); + if (result > unicode_max_char()) + return false; s += 6; return true; }