[AddressSanitizer] Only instrument globals of default address space
authorKarl-Johan Karlsson <karl-johan.karlsson@ericsson.com>
Wed, 30 Oct 2019 06:45:39 +0000 (07:45 +0100)
committerKarl-Johan Karlsson <karl-johan.karlsson@ericsson.com>
Wed, 30 Oct 2019 08:32:19 +0000 (09:32 +0100)
commit760ed8da98e3c4cd80e92bbdcc78c181f36f71d4
tree56d4113da037f37fe623bcf4643689227727d7bf
parentf15cf93899df3e8863207b40c3900facb0ccc356
[AddressSanitizer] Only instrument globals of default address space

The address sanitizer ignore memory accesses from different address
spaces, however when instrumenting globals the check for different
address spaces is missing. This result in assertion failure. The fault
was found in an out of tree target.

The patch skip all globals of non default address space.

Reviewed By: leonardchan, vitalybuka

Differential Revision: https://reviews.llvm.org/D68790
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
llvm/test/Instrumentation/AddressSanitizer/global_addrspace.ll [new file with mode: 0644]