diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index f1efd2689e38..95406f98368e 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -973,6 +973,11 @@ TabParent::RecvPDocAccessibleConstructor(PDocAccessibleParent* aDoc, #ifdef XP_WIN a11y::WrapperFor(doc)->SetID(aMsaaID); MOZ_ASSERT(!aDocCOMProxy.IsNull()); +#ifdef NIGHTLY_BUILD + if (aDocCOMProxy.IsNull()) { + return IPC_FAIL(this, "Constructing a top-level PDocAccessible with null COM proxy"); + } +#endif RefPtr proxy(aDocCOMProxy.Get()); doc->SetCOMInterface(proxy); diff --git a/ipc/mscom/Interceptor.cpp b/ipc/mscom/Interceptor.cpp index 52e192705db7..a62a51086ecd 100644 --- a/ipc/mscom/Interceptor.cpp +++ b/ipc/mscom/Interceptor.cpp @@ -28,12 +28,26 @@ #include "nsThreadUtils.h" #include "nsXULAppAPI.h" +#if defined(MOZ_DEV_EDITION) || defined(RELEASE_OR_BETA) + #define ENSURE_HR_SUCCEEDED(hr) \ - MOZ_ASSERT(SUCCEEDED((HRESULT)hr)); \ if (FAILED((HRESULT)hr)) { \ return hr; \ } +#else + +#define ENSURE_HR_SUCCEEDED(hr) \ + if (FAILED((HRESULT)hr)) { \ + nsPrintfCString location("ENSURE_HR_SUCCEEDED \"%s\": %u", __FILE__, __LINE__); \ + nsPrintfCString hrAsStr("0x%08X", (HRESULT)hr); \ + CrashReporter::AnnotateCrashReport(location, hrAsStr); \ + MOZ_DIAGNOSTIC_ASSERT(SUCCEEDED((HRESULT)hr)); \ + return hr; \ + } + +#endif // defined(MOZ_DEV_EDITION) || defined(RELEASE_OR_BETA) + namespace mozilla { namespace mscom { namespace detail {