Bug 1305422 - part 16 - don't call size_backward in nsExceptionHandler.cpp; r=ted.mielczarek
authorNathan Froyd <froydnj@mozilla.com>
Thu, 29 Sep 2016 22:33:57 -0400
changeset 315879 8ad96d4c9d427e135e51b9dd7af31a9d99782e2c
parent 315878 daf738c4a41117ef270fc56dd1ec10121b596802
child 315880 f933f6215b9d67ab84255642d8ab2cb208f051c1
push id30757
push usercbook@mozilla.com
push dateFri, 30 Sep 2016 10:02:43 +0000
treeherdermozilla-central@5ffed033557e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted.mielczarek
bugs1305422
milestone52.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 1305422 - part 16 - don't call size_backward in nsExceptionHandler.cpp; r=ted.mielczarek
toolkit/crashreporter/nsExceptionHandler.cpp
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
@@ -2058,27 +2058,29 @@ nsresult UnsetExceptionHandler()
   dumpSafetyLock = nullptr;
 
   return NS_OK;
 }
 
 static void ReplaceChar(nsCString& str, const nsACString& character,
                         const nsACString& replacement)
 {
-  nsCString::const_iterator start, end;
-
-  str.BeginReading(start);
+  nsCString::const_iterator iter, end;
+
+  str.BeginReading(iter);
   str.EndReading(end);
 
-  while (FindInReadable(character, start, end)) {
-    int32_t pos = end.size_backward();
+  while (FindInReadable(character, iter, end)) {
+    nsCString::const_iterator start;
+    str.BeginReading(start);
+    int32_t pos = end - start;
     str.Replace(pos - 1, 1, replacement);
 
-    str.BeginReading(start);
-    start.advance(pos + replacement.Length() - 1);
+    str.BeginReading(iter);
+    iter.advance(pos + replacement.Length() - 1);
     str.EndReading(end);
   }
 }
 
 static bool DoFindInReadable(const nsACString& str, const nsACString& value)
 {
   nsACString::const_iterator start, end;
   str.BeginReading(start);