Closed Bug 1238529 Opened 4 years ago Closed 4 years ago

[Static Analysis][Result is not floating-point] In function nsCSSRendering::PaintBoxShadowInner from nsCSSRendering.cpp

Categories

(Core :: Layout, defect)

defect
Not set

Tracking

()

RESOLVED WONTFIX
Tracking Status
firefox46 --- affected

People

(Reporter: andi, Assigned: andi)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: CID 1347694)

Attachments

(1 obsolete file)

The Static Analysis tool Coverity added that result of the division is truncated to an integer:

>>    Float borderSizes[4] = {
>>      Float(border.top / twipsPerPixel),
>>      Float(border.right / twipsPerPixel),
>>      Float(border.bottom / twipsPerPixel),
>>      Float(border.left / twipsPerPixel)
>>    };

In this way precision is lost during division since the division is done on integer number.
Attachment #8706357 - Attachment description: MozReview Request: Bug 1238529 - fixed precision when division on two int; r= roc → MozReview Request: Bug 1238529 - fixed precision when division on two int; r?roc
Attachment #8706357 - Flags: review?(roc)
Comment on attachment 8706357 [details]
MozReview Request: Bug 1238529 - fixed precision when division on two int; r?roc

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/30321/diff/1-2/
Comment on attachment 8706357 [details]
MozReview Request: Bug 1238529 - fixed precision when division on two int; r?roc

https://reviewboard.mozilla.org/r/30321/#review27183

I'm not convinced this is a bug. We don't really want fractional pixels here. I suggest we don't fix this.
Attachment #8706357 - Flags: review?(roc)
https://reviewboard.mozilla.org/r/30321/#review27183

Thanks, i will wave it from Coverity.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
Attachment #8706357 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.