]> granicus.if.org Git - icu/commitdiff
ICU-20680 revert use of UPRV_UNREACHABLE in places actually reached in production...
authorPeter Edberg <pedberg@unicode.org>
Wed, 28 Aug 2019 04:29:51 +0000 (21:29 -0700)
committerpedberg-icu <42151464+pedberg-icu@users.noreply.github.com>
Wed, 28 Aug 2019 06:23:36 +0000 (23:23 -0700)
icu4c/source/common/uinvchar.cpp
icu4c/source/i18n/usearch.cpp

index 6e5fb48cf43a6ee2febd4e33667cd20b5e6f03c3..05bcf10df48921a090f13b92d43c451e20a450a4 100644 (file)
@@ -207,7 +207,8 @@ u_UCharsToChars(const UChar *us, char *cs, int32_t length) {
     while(length>0) {
         u=*us++;
         if(!UCHAR_IS_INVARIANT(u)) {
-            UPRV_UNREACHABLE; /* Variant characters were used. These are not portable in ICU. */
+            U_ASSERT(FALSE); /* Variant characters were used. These are not portable in ICU. */
+            u=0;
         }
         *cs++=(char)UCHAR_TO_CHAR(u);
         --length;
index 1fc6e133b45b01171496276e0490bfedbf024ed0..1baec3d6cc0199bacace3607a9561c35484f2319 100644 (file)
@@ -3544,7 +3544,8 @@ const CEI *CEIBuffer::get(int32_t index) {
     //   Verify that it is the next one in sequence, which is all
     //   that is allowed.
     if (index != limitIx) {
-        UPRV_UNREACHABLE;
+        U_ASSERT(FALSE);
+        return NULL;
     }
 
     // Manage the circular CE buffer indexing
@@ -3581,7 +3582,8 @@ const CEI *CEIBuffer::getPrevious(int32_t index) {
     //   Verify that it is the next one in sequence, which is all
     //   that is allowed.
     if (index != limitIx) {
-        UPRV_UNREACHABLE;
+        U_ASSERT(FALSE);
+        return NULL;
     }
 
     // Manage the circular CE buffer indexing