Open Bug 2089960 Opened 16 days ago

Move an assertion after its null check in PresShell::DispatchTouchEventToDOM

Categories

(Core :: Layout, task)

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.

In PresShell::DispatchTouchEventToDOM, MOZ_ASSERT(!touch->mIsTouchEventSuppressed); dereferences touch before the following if (!touch || !touch->mChanged) continue; checks it for null. Move the assertion below that check.

Current code:

    // TouchManager::PreHandleEvent.
    MOZ_ASSERT(!touch->mIsTouchEventSuppressed);

Link to the code:
https://searchfox.org/firefox-main/source/layout/base/PresShell.cpp

To verify the fix:

./mach build
./mach test layout/base/tests --headless

This was reported by Coverity Scan (CID 1447856). 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.