Closed Bug 1410617 Opened 7 years ago Closed 7 years ago

Deadcode in nsStreamLoader::OnStartRequest on logical comparison

Categories

(Core :: Networking, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: Sylvestre, Assigned: Sylvestre)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Just like in bug 1410379, we have the same issue in nsStreamLoader.cpp

In file included from /data/jenkins/workspace/firefox-clang-last/obj-x86_64-pc-linux-gnu/netwerk/base/Unified_cpp_netwerk_base4.cpp:11:
/data/jenkins/workspace/firefox-clang-last/netwerk/base/nsStreamLoader.cpp:76:35: error: comparison 'uint64_t' (aka 'unsigned long') > 18446744073709551615 is always false [-Werror,-Wtautological-constant-compare]
      if (uint64_t(contentLength) > std::numeric_limits<size_t>::max()) {
          ~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comment on attachment 8920778 [details]
Bug 1410617 - compare uint64_t with size_t only on 32bit platforms.

https://reviewboard.mozilla.org/r/191766/#review196988
Attachment #8920778 - Flags: review?(valentin.gosu) → review+
Comment on attachment 8920779 [details]
Bug 1410617 - Fix a tiny typo

https://reviewboard.mozilla.org/r/191768/#review196990
Attachment #8920779 - Flags: review?(bpostelnicu) → review+
Pushed by sledru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/54de317b854a
compare uint64_t with size_t only on 32bit platforms. r=valentin
https://hg.mozilla.org/integration/autoland/rev/ea486c5d3380
Fix a tiny typo r=andi
https://hg.mozilla.org/mozilla-central/rev/54de317b854a
https://hg.mozilla.org/mozilla-central/rev/ea486c5d3380
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
No longer blocks: clang-based-analysis
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: