diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 534ebd85d..b9387dad5 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -5323,11 +5323,16 @@ nsDocShell::Reload(uint32_t aReloadFlags) } } - rv = InternalLoad(mCurrentURI, + // Stack variables to ensure changes to the member variables don't affect + // the call. + nsCOMPtr currentURI = mCurrentURI; + nsCOMPtr referrerURI = mReferrerURI; + uint32_t referrerPolicy = mReferrerPolicy; + rv = InternalLoad(currentURI, originalURI, loadReplace, - mReferrerURI, - mReferrerPolicy, + referrerURI, + referrerPolicy, principal, flags, nullptr, // No window target diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 5346ba11d..dd349274f 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -9411,7 +9411,7 @@ void nsGlobalWindow::SetActive(bool aActive) { nsPIDOMWindow::SetActive(aActive); - if (mDoc) { + if (MOZ_LIKELY(mDoc)) { NotifyDocumentTree(mDoc, nullptr); } }