Closed
Bug 1365699
Opened 7 years ago
Closed 7 years ago
Unreachable code in /js/src/jit/x86-shared/Disassembler-x86-shared.cpp
Categories
(Core :: JavaScript Engine: JIT, defect)
Tracking
()
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: janx, Assigned: janx)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 2 obsolete files)
1.50 KB,
patch
|
janx
:
review+
|
Details | Diff | Splinter Review |
When running static analysis on /js/src/jit/x86-shared/Disassembler-x86-shared.cpp with the following command: $ run-clang-tidy-4.0.py -j 18 -p obj-x86_64-pc-linux-gnu/ -checks=-*,clang-analyzer-deadcode.DeadStores js/src/jit/x86-shared/ We get the following warnings: /home/user/firefox/js/src/jit/x86-shared/Disassembler-x86-shared.cpp:226:13: warning: Value stored to 'l' is never read [clang-analyzer-deadcode.DeadStores] l = (c4b >> 2) & 0x1; ^ /home/user/firefox/js/src/jit/x86-shared/Disassembler-x86-shared.cpp:226:13: note: Value stored to 'l' is never read l = (c4b >> 2) & 0x1; ^ /home/user/firefox/js/src/jit/x86-shared/Disassembler-x86-shared.cpp:236:13: warning: Value stored to 'l' is never read [clang-analyzer-deadcode.DeadStores] l = (c5 >> 2) & 0x1; ^ /home/user/firefox/js/src/jit/x86-shared/Disassembler-x86-shared.cpp:236:13: note: Value stored to 'l' is never read l = (c5 >> 2) & 0x1; ^ This is because the `switch (m)` at Disassembler-x86-shared.cpp:245 jumps out of the scope (either with a `goto opcode_done` or a `MOZ_CRASH(...)`) before the `if (l != 0) // 256-bit SIMD` check can be reached, causing the variable `l` to never be read.
Assignee | ||
Comment 1•7 years ago
|
||
By moving the sanity check above the switch, we make the code reachable again.
Attachment #8868684 -
Flags: review?(bbouvier)
Assignee | ||
Comment 2•7 years ago
|
||
Fixed to 4-space indent.
Attachment #8868698 -
Flags: review?(bbouvier)
Assignee | ||
Updated•7 years ago
|
Attachment #8868684 -
Attachment is obsolete: true
Attachment #8868684 -
Flags: review?(bbouvier)
Comment 3•7 years ago
|
||
Comment on attachment 8868698 [details] [diff] [review] Fix unreachable code in Disassembler-x86-shared.cpp. Review of attachment 8868698 [details] [diff] [review]: ----------------------------------------------------------------- Looks good! If this passes jit tests, let's land it. Thanks for the patch!
Attachment #8868698 -
Flags: review?(bbouvier) → review+
Assignee | ||
Comment 4•7 years ago
|
||
Rebased, r+ carried over, try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=1eeaab1130c2
Attachment #8869733 -
Flags: review+
Assignee | ||
Updated•7 years ago
|
Attachment #8868698 -
Attachment is obsolete: true
Assignee | ||
Comment 5•7 years ago
|
||
The assertion failures in /src/ld/ld.hpp on "OS X 10.7 opt" seem unrelated (see orange try jobs "cgc" and "p"). Please land this patch.
Keywords: checkin-needed
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/37e9f6f9d1e8 Fix unreachable code in Disassembler-x86-shared.cpp. r=bbouvier
Keywords: checkin-needed
Comment 7•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/37e9f6f9d1e8
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Assignee | ||
Updated•7 years ago
|
Depends on: clang-based-analysis
Assignee | ||
Updated•7 years ago
|
Blocks: clang-based-analysis
No longer depends on: clang-based-analysis
You need to log in
before you can comment on or make changes to this bug.
Description
•