$OpenBSD$ index ebcafca..6c52e5f 100644 --- parser/html/nsHtml5TreeOpExecutor.cpp.orig Fri Feb 20 15:40:38 2015 +++ parser/html/nsHtml5TreeOpExecutor.cpp Fri Feb 20 15:40:38 2015 @@ -411,7 +411,11 @@ nsHtml5TreeOpExecutor::RunFlushLoop() GetParser()->GetStreamParser(); // Now parse content left in the document.write() buffer queue if any. // This may generate tree ops on its own or dequeue a speculation. - GetParser()->ParseUntilBlocked(); + nsresult rv = GetParser()->ParseUntilBlocked(); + if (NS_FAILED(rv)) { + MarkAsBroken(rv); + return; + } } if (mOpQueue.IsEmpty()) { @@ -496,21 +500,24 @@ nsHtml5TreeOpExecutor::RunFlushLoop() } } -void +nsresult nsHtml5TreeOpExecutor::FlushDocumentWrite() { + nsresult rv = IsBroken(); + NS_ENSURE_SUCCESS(rv, rv); + FlushSpeculativeLoads(); // Make sure speculative loads never start after the // corresponding normal loads for the same URLs. if (MOZ_UNLIKELY(!mParser)) { // The parse has ended. mOpQueue.Clear(); // clear in order to be able to assert in destructor - return; + return rv; } if (mFlushState != eNotFlushing) { // XXX Can this happen? In case it can, let's avoid crashing. - return; + return rv; } mFlushState = eInFlush; @@ -545,7 +552,7 @@ nsHtml5TreeOpExecutor::FlushDocumentWrite() } NS_ASSERTION(mFlushState == eInDocUpdate, "Tried to perform tree op outside update batch."); - nsresult rv = iter->Perform(this, &scriptElement); + rv = iter->Perform(this, &scriptElement); if (NS_FAILED(rv)) { MarkAsBroken(rv); break; @@ -560,13 +567,14 @@ nsHtml5TreeOpExecutor::FlushDocumentWrite() if (MOZ_UNLIKELY(!mParser)) { // Ending the doc update caused a call to nsIParser::Terminate(). - return; + return rv; } if (scriptElement) { // must be tail call when mFlushState is eNotFlushing RunScript(scriptElement); } + return rv; } // copied from HTML content sink