mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1265036
- Use NS_ABORT_OOM() if try_realloc() fails. r=billm
This will give the crash a proper OOM annotation.
This commit is contained in:
parent
97ce0e7053
commit
fac746e08b
@ -5,6 +5,7 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "buffer.h"
|
||||
#include "nsDebug.h"
|
||||
|
||||
Buffer::Buffer()
|
||||
: mBuffer(nullptr),
|
||||
@ -59,7 +60,9 @@ Buffer::try_realloc(size_t newlength)
|
||||
|
||||
// If we're growing the buffer, crash. If we're shrinking, then we continue to
|
||||
// use the old (larger) buffer.
|
||||
MOZ_RELEASE_ASSERT(newlength <= mReserved);
|
||||
if (newlength > mReserved) {
|
||||
NS_ABORT_OOM(newlength);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user