Bug 917593 - Don't assert for zero-length strings. r=Waldo
authorBobby Holley <bobbyholley@gmail.com>
Fri, 27 Sep 2013 18:34:24 +0200
changeset 149011 01198082967c5934ec7c67e25ec4efb178770582
parent 149010 961256d21b8efafe251c1f29b6c53e8a39298a2d
child 149012 6b8e91bf52b637c04d37f92fd7fae0e01924640c
push id25366
push userkwierso@gmail.com
push dateSat, 28 Sep 2013 02:13:38 +0000
treeherdermozilla-central@e1914e294152 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs917593
milestone27.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 917593 - Don't assert for zero-length strings. r=Waldo
mfbt/Endian.h
--- a/mfbt/Endian.h
+++ b/mfbt/Endian.h
@@ -233,19 +233,19 @@ class EndianUtils
     /**
      * Assert that the memory regions [dest, dest+count) and [src, src+count]
      * do not overlap.  count is given in bytes.
      */
     static void assertNoOverlap(const void* dest, const void* src, size_t count)
     {
       DebugOnly<const uint8_t*> byteDestPtr = static_cast<const uint8_t*>(dest);
       DebugOnly<const uint8_t*> byteSrcPtr = static_cast<const uint8_t*>(src);
-      MOZ_ASSERT((byteDestPtr < byteSrcPtr &&
+      MOZ_ASSERT((byteDestPtr <= byteSrcPtr &&
                   byteDestPtr + count <= byteSrcPtr) ||
-                 (byteSrcPtr < byteDestPtr &&
+                 (byteSrcPtr <= byteDestPtr &&
                   byteSrcPtr + count <= byteDestPtr));
     }
 
     template<typename T>
     static void assertAligned(T* ptr)
     {
       MOZ_ASSERT((uintptr_t(ptr) % sizeof(T)) == 0, "Unaligned pointer!");
     }