Bug 937550 - Report OOM to stderr in JS_MORE_DETERMINISTIC builds. r=jorendorff

This commit is contained in:
Jan de Mooij 2013-11-19 22:20:37 +01:00
parent 9ac3576ea9
commit 3e3050489e

View File

@ -352,6 +352,15 @@ PopulateReportBlame(JSContext *cx, JSErrorReport *report)
void
js_ReportOutOfMemory(ThreadSafeContext *cxArg)
{
#ifdef JS_MORE_DETERMINISTIC
/*
* OOMs are non-deterministic, especially across different execution modes
* (e.g. interpreter vs JIT). In more-deterministic builds, print to stderr
* so that the fuzzers can detect this.
*/
fprintf(stderr, "js_ReportOutOfMemory called\n");
#endif
if (cxArg->isForkJoinSlice()) {
cxArg->asForkJoinSlice()->setPendingAbortFatal(ParallelBailoutOutOfMemory);
return;