Closed Bug 1438108 Opened 6 years ago Closed 6 years ago

[Static Analysis][Logically dead code] in RestyleManager::ChangeHintToString

Categories

(Core :: Layout, enhancement, P3)

enhancement

Tracking

()

RESOLVED WONTFIX

People

(Reporter: Sylvestre, Assigned: manishkk)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: [CID 1429500])

Coverity thinks that rest = 0:
  uint32_t rest = aHint & ~static_cast<uint32_t>((1ull << ArrayLength(names)) - 1);

Causing code to be dead code:
https://searchfox.org/mozilla-central/source/layout/base/RestyleManager.cpp#472-475
Hiroyuki, do you agree with this?
Flags: needinfo?(hikezoe)
Oh right, indeed.  I didn't notice it.  But it will be used when we need to expand change hints to uint64_t, so I don't think it's not a big deal.
Flags: needinfo?(hikezoe)
[ Triage 2017/02/20: P3 ]
Priority: -- → P3
need to remove this code only
https://searchfox.org/mozilla-central/source/layout/base/RestyleManager.cpp#472-475

or anything else to do?
Flags: needinfo?(sledru)
Assignee: nobody → 1991manish.kumar
Manish, the code from the original report has moved (since the link was to current tip rather than whatever commit Coverity was run on), and should be this:

https://searchfox.org/mozilla-central/rev/5a744713370ec47969595e369fd5125f123e6d24/layout/base/RestyleManager.cpp#630-633

But as Hiro mentions, this is not a problem, given it was meant to handle how ever many change hint bits we currently use.

It doesn't seem worth trying to avoid the warning by changing the code.  Sylvestre, can we whitelist this warning?
Done, sorry Manish!
Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(sledru)
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.