Closed Bug 1416012 Opened 7 years ago Closed 7 years ago

Code in LogicalRect::IsEmpty is fishy

Categories

(Core :: Layout, defect)

53 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: bzbarsky, Assigned: milan)

References

Details

Attachments

(1 file)

After bug 1389152 it's doing:

    return mISize <= 0 || mBSize << 0;

which leads to these compiler warnings:

 0:52.16 ../../dist/include/mozilla/WritingModes.h: In member function ‘bool mozilla::LogicalRect::IsEmpty() const’:
 0:52.16 ../../dist/include/mozilla/WritingModes.h:1699:34: warning: ‘<<’ in boolean context, did you mean ‘<’ ? [-Wint-in-bool-context]
 0:52.16      return mISize <= 0 || mBSize << 0;
 0:52.16                            ~~~~~~~^~~~

I think I agree with the compiler.  This will return true any time mBSize is nonzero, afaict, which seems highly dubious.
Flags: needinfo?(milan)
Maybe the tree is green because this method is unused?
(In reply to Boris Zbarsky [:bz] (no decent commit message means r-) from comment #0)
> After bug 1389152 it's doing:
> 
>     return mISize <= 0 || mBSize << 0;

Yikes.
Comment on attachment 8927349 [details] [diff] [review]
Fixing a typo where << was used instead of <= (in a currently unused function LogicalRect::IsEmpty)

r=me
Attachment #8927349 - Flags: review?(bzbarsky) → review+
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/56d0ff94578a
Fix a typo where << was used instead of <= (in a currently unused function LogicalRect::IsEmpty). r=bz
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/56d0ff94578a
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: