Remove a dead numberOfValidAttributes == 0 check in Modules.cpp
Categories
(Core :: JavaScript Engine, task, P3)
Tracking
()
People
(Reporter: Sylvestre, Unassigned, Mentored)
References
(Blocks 1 open bug)
Details
(Keywords: good-first-bug, Whiteboard: [lang=c++])
Filing as a good first bug to learn workflows.
numberOfAttributes == 0 already returns earlier, and every loop iteration either returns false or increments numberOfValidAttributes, so the later if (numberOfValidAttributes == 0) can never be true. Remove it.
Current code:
if (numberOfValidAttributes == 0) {
return true;
Link to the code:
https://searchfox.org/firefox-main/source/js/src/vm/Modules.cpp
To verify the fix:
./mach build
./mach jit-test modules
This was reported by Coverity Scan (CID 1694815). The analyzer will stop reporting it once the change lands.
Tutorial to contribute:
https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
https://firefox-source-docs.mozilla.org/contributing/stack_quickref.html
Please don't ask for the bug to be assigned. It will be automatically assigned to the first patch.
Comment 1•9 days ago
|
||
I think coverity is talking about https://searchfox.org/firefox-main/rev/47f2a88cbab9072c8f8f156494b92d6891e488fb/js/src/vm/Modules.cpp#3216-3219
Description
•