Fix hilarious bug in js_malloc: it fails once every 2^32 allocations in DEBUG builds.
Bug 730270, r=luke.
--- a/js/public/Utility.h
+++ b/js/public/Utility.h
@@ -110,17 +110,17 @@ extern JS_PUBLIC_API(void) JS_Abort(void
* In order to test OOM conditions, when the shell command-line option
* |-A NUM| is passed, we fail continuously after the NUM'th allocation.
*/
extern JS_PUBLIC_DATA(uint32_t) OOM_maxAllocations; /* set from shell/js.cpp */
extern JS_PUBLIC_DATA(uint32_t) OOM_counter; /* data race, who cares. */
# define JS_OOM_POSSIBLY_FAIL() \
do \
{ \
- if (OOM_counter++ >= OOM_maxAllocations) { \
+ if (++OOM_counter > OOM_maxAllocations) { \
return NULL; \
} \
} while (0)
# else
# define JS_OOM_POSSIBLY_FAIL() do {} while(0)
# endif