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
Loading
Please register or sign in to comment