Bug 1232100 - "Check charsWritten in non-debug builds.". r=jcoppeard
authorWei Wu <lazyparser>
Wed, 16 Dec 2015 06:54:00 +0100
changeset 316137 5a4f006fa68ef8066b50d39af0d3c9396016b56d
parent 316136 a87d841e91aa36291daad48098ce257d4c8a1113
child 316138 1adf7961d21753a0033328d79a813d6d70f9da73
push id8516
push userjlund@mozilla.com
push dateFri, 18 Dec 2015 00:52:34 +0000
reviewersjcoppeard
bugs1232100
milestone46.0a1
Bug 1232100 - "Check charsWritten in non-debug builds.". r=jcoppeard
js/src/jsprf.cpp
--- a/js/src/jsprf.cpp
+++ b/js/src/jsprf.cpp
@@ -1016,17 +1016,17 @@ JS_vsnprintf(char* out, uint32_t outlen,
 
     ss.stuff = LimitStuff;
     ss.base = out;
     ss.cur = out;
     ss.maxlen = outlen;
     (void) dosprintf(&ss, fmt, ap);
 
     uint32_t charsWritten = ss.cur - ss.base;
-    MOZ_ASSERT(charsWritten > 0);
+    MOZ_RELEASE_ASSERT(charsWritten > 0);
 
     // If we didn't append a null then we must have hit the buffer limit. Write
     // a null terminator now and return a value indicating that we failed.
     if (ss.cur[-1] != '\0') {
         ss.cur[-1] = '\0';
         return outlen;
     }