Open Bug 2089967 Opened 13 days ago Updated 9 days ago

Remove a dead numberOfValidAttributes == 0 check in Modules.cpp

Categories

(Core :: JavaScript Engine, task, P3)

task

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.

You need to log in before you can comment on or make changes to this bug.