Closed Bug 1502421 Opened 6 years ago Closed 6 years ago

fix undefined behavior in PendingFullscreenChangeList

Categories

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

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: froydnj, Assigned: froydnj)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

The order of evaluation of x and y in x->Func(y) is undefined, but the
code in PendingFullscreenChangeList depends on x being evaluated before
y.  We should make the ordering explicit.  (The ordering is fully
specified in C++17, but we're not ready to make that switch yet.)
None of our current compilers implement the bad evaluation order, but MSVC for
AArch64 does, and we might as well remove some undefined behavior from our code
in any event.
Attachment #9020374 - Flags: review?(continuation)
Comment on attachment 9020374 [details] [diff] [review]
fix undefined behavior in PendingFullscreenChangeList

Review of attachment 9020374 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/base/nsDocument.cpp
@@ +10543,5 @@
>        , mRootShellForIteration(aDoc->GetDocShell())
>      {
>        if (mCurrent) {
>          if (mRootShellForIteration && aOption == eDocumentsWithSameRoot) {
> +          nsCOMPtr<nsIDocShellTreeItem> root;

Maybe put a comment here? This one looks a little odd and may tempt somebody to "clean" it up.
Attachment #9020374 - Flags: review?(continuation) → review+
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/6baeb0cb9aeb
fix undefined behavior in PendingFullscreenChangeList; r=mccr8
https://hg.mozilla.org/mozilla-central/rev/6baeb0cb9aeb
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
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: