Closed Bug 1024322 Opened 10 years ago Closed 10 years ago

Replace new calls to MOZ_ASSUME_UNREACHABLE added in dom

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla33
Tracking Status
firefox32 --- wontfix
firefox33 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

References

Details

Attachments

(1 file)

This patch is part of bug 990764, replacing calls to deprecated MOZ_ASSUME_UNREACHABLE with MOZ_CRASH or MOZ_ASSERT_UNREACHABLE (which is an assertion in all debug builds and release builds on the Nightly channel).

These calls to MOZ_ASSUME_UNREACHABLE in dom/ have crept in since I removed them all in a patch you reviewed in bug 990764 comment 24. :)
Attachment #8438962 - Flags: review?(bugs)
Comment on attachment 8438962 [details] [diff] [review]
remove-dom-MOZ_ASSUME_UNREACHABLE.patch

>+++ b/dom/datastore/DataStoreDB.cpp
>@@ -112,18 +112,17 @@ DataStoreDB::HandleEvent(nsIDOMEvent* aE
>   if (type.EqualsASCII("error") || type.EqualsASCII("blocked")) {
>     RemoveEventListeners();
>     mState = Inactive;
>     mCallback->Run(this, false);
>     mRequest = nullptr;
>     return NS_OK;
>   }
> 
>-  MOZ_ASSUME_UNREACHABLE("This should not happen");
>-  return NS_OK;
>+  MOZ_CRASH("This should not happen");
You need some return value here.
so keep return NS_OK;
Attachment #8438962 - Flags: review?(bugs) → review+
(In reply to Olli Pettay [:smaug] from comment #1)
> >-  MOZ_ASSUME_UNREACHABLE("This should not happen");
> >-  return NS_OK;
> >+  MOZ_CRASH("This should not happen");
> You need some return value here.
> so keep return NS_OK;

Why do we need a return value? The compiler (or at least the ones we use on the try servers) knows that the function won't return through that code path and doesn't emit a compilation error.
^ comment 2?
Flags: needinfo?(bugs)
Oh, if it compiles, fine. That is just surprising.
Flags: needinfo?(bugs)
https://hg.mozilla.org/mozilla-central/rev/99682bd658ed
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
Depends on: 1036776
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: