mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 03:56:08 +00:00

Summary: GCC would like to emit a function call to report a tag mismatch rather than hard-code the `brk` instruction directly. __hwasan_tag_mismatch_stub contains most of the functionality to do this already, but requires exposure in the dynamic library. This patch moves __hwasan_tag_mismatch_stub outside of the anonymous namespace that it was defined in and declares it in hwasan_interface_internal.h. We also add the ability to pass sizes larger than 16 bytes to this reporting function by providing a fourth parameter that is only looked at when the size provided is not in the original accepted range. This does not change the behaviour where it is already being called, since the previous definition only accepted sizes up to 16 bytes and hence the change in behaviour is not seen by existing users. The change in declaration does not matter, since the only existing use is in the __hwasan_tag_mismatch function written in assembly. Reviewers: eugenis, kcc, pcc, #sanitizers Reviewed By: eugenis, #sanitizers Subscribers: kristof.beyls, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D69113 Patch by Matthew Malcomson <matthew.malcomson@arm.com>