https://bugs.winehq.org/show_bug.cgi?id=49174
Bug ID: 49174 Summary: Duplicate checking iter->parent in mshtml/htmlwindow.c Product: Wine Version: 5.8 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: mshtml Assignee: wine-bugs@winehq.org Reporter: mikrutrafal54@gmail.com Distribution: ---
Should be probably `iter && iter->parent`
https://github.com/wine-mirror/wine/blob/59987bc9ecdd0dbafd768a95c21a14884bc...
https://bugs.winehq.org/show_bug.cgi?id=49174
Michael McGuire spoon0042@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |spoon0042@hotmail.com
--- Comment #1 from Michael McGuire spoon0042@hotmail.com --- If you really wanted you could check window == NULL and return, saving a test. :)
https://bugs.winehq.org/show_bug.cgi?id=49174
--- Comment #2 from Michael McGuire spoon0042@hotmail.com --- Or even:
void get_top_window(HTMLOuterWindow *window, HTMLOuterWindow **ret) { HTMLOuterWindow *iter = window;
if (iter) while (iter->parent) iter = iter->parent;
*ret = iter; }
I may be bored.
https://bugs.winehq.org/show_bug.cgi?id=49174
--- Comment #3 from Michael McGuire spoon0042@hotmail.com --- Still bored so for fun I did a quick test and gcc optimizes out a test anyway (with -O2) resulting in identical assembly for the loop. I'll shut up now. :)
https://bugs.winehq.org/show_bug.cgi?id=49174
Jacek Caban jacek@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |d202e4a3864c1f15730e3e3c63e | |2928e6171c2cb Resolution|--- |FIXED CC| |jacek@codeweavers.com Status|UNCONFIRMED |RESOLVED
--- Comment #4 from Jacek Caban jacek@codeweavers.com --- https://source.winehq.org/git/wine.git/commitdiff/d202e4a3864c1f15730e3e3c63...
https://bugs.winehq.org/show_bug.cgi?id=49174
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #5 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 7.0-rc5.