Bug 1277034 - Ensure that OOM message is properly flushed to stderr. (r=terrence, a=KWierso)
authorEric Faust <efaustbmo@gmail.com>
Thu, 21 Jul 2016 16:21:20 -0700
changeset 331281 1da606ef3da99b620f05dbae76570646f69af5b2
parent 331280 3e6ee8c6b56b84368c3a464c86067af78971ada0
child 331282 607f7217e5ec8f910382992f752a03b5a67de36e
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence, KWierso
bugs1277034
milestone50.0a1
Bug 1277034 - Ensure that OOM message is properly flushed to stderr. (r=terrence, a=KWierso)
js/src/shell/js.cpp
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -6042,17 +6042,17 @@ js::shell::AutoReportException::~AutoRep
     RootedValue exn(cx);
     (void) JS_GetPendingException(cx, &exn);
 
     JS_ClearPendingException(cx);
 
     ShellContext* sc = GetShellContext(cx);
     js::ErrorReport report(cx);
     if (!report.init(cx, exn, js::ErrorReport::WithSideEffects)) {
-        fprintf(stderr, "out of memory initializing ErrorReport\n");
+        PrintError(cx, stderr, "out of memory initializing ErrorReport", nullptr, reportWarnings);
         JS_ClearPendingException(cx);
         return;
     }
 
     MOZ_ASSERT(!JSREPORT_IS_WARNING(report.report()->flags));
 
     FILE* fp = ErrorFilePointer();
     PrintError(cx, fp, report.message(), report.report(), reportWarnings);