Bug 1616379 - Weaken the MOZ_ASSERT on failing to load a hyphenation resource to an NS_ASSERTION. r=jya
authorJonathan Kew <jkew@mozilla.com>
Wed, 20 May 2020 12:01:50 +0000
changeset 531221 740634c137bbc1e06e8d5a649f87d4a8146c5174
parent 531220 b4607c8f46610c7c5df462d1594096e62c76ce79
child 531222 2371dd3a498e933a1f3e68c41f7b0808745daa52
push id37435
push userapavel@mozilla.com
push dateWed, 20 May 2020 15:28:23 +0000
treeherdermozilla-central@5415da14ec9a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1616379
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1616379 - Weaken the MOZ_ASSERT on failing to load a hyphenation resource to an NS_ASSERTION. r=jya Differential Revision: https://phabricator.services.mozilla.com/D76110
intl/hyphenation/glue/nsHyphenator.cpp
--- a/intl/hyphenation/glue/nsHyphenator.cpp
+++ b/intl/hyphenation/glue/nsHyphenator.cpp
@@ -183,17 +183,20 @@ nsHyphenator::nsHyphenator(nsIURI* aURI,
     aURI->GetFilePath(path);
     UniquePtr<const HyphDic> dic(mapped_hyph_load_dictionary(path.get()));
     if (dic) {
       mDict = AsVariant(std::move(dic));
       return;
     }
   }
 
-  MOZ_ASSERT_UNREACHABLE("invalid hyphenation resource?");
+  nsAutoCString msg;
+  aURI->GetSpec(msg);
+  msg.Insert("Invalid hyphenation resource: ", 0);
+  NS_ASSERTION(false, msg.get());
 }
 
 bool nsHyphenator::IsValid() {
   return mDict.match(
       [](const void*& ptr) { return ptr != nullptr; },
       [](RefPtr<ipc::SharedMemoryBasic>& shm) { return shm != nullptr; },
       [](mozilla::UniquePtr<const HyphDic>& hyph) { return hyph != nullptr; });
 }