Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit ee2f164e authored by Pirama Arumuga Nainar's avatar Pirama Arumuga Nainar
Browse files

inputflinger_tests: Fix asan error about new-delete type mismatch

Cast the value returned by InputDispatcher::verifyInputEvent to the
correct event type and call delete explicitly on the pointer.  This
fixes the `new-delete-type-mismatch` reported by asan with
clang-r547379.

We cannot rely on virtual destructor calls because InputEvent and
subclasses don't have a virtual destructor.  The proper fix is to either
consider using std::variant in some way, or introduce an intermediate
POD data structure that we will put the data into just prior to signing.
Adding virtual functions to these classes is undesirable as the bytes in
these objects are getting signed.

Bug: 392703785
Test: run inputflinger_tests on the host with aosp/3419479
Change-Id: Ie78684539536c8b62acc8d540df57b2bbaac3649
parent 52b4e753
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment