mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 22:06:06 +00:00

An updated version of r191586 with bug fix. Struct-path aware TBAA generates tags to specify the access path, while scalar TBAA only generates tags to scalar types. We should not generate a TBAA tag with null being the first field. When a TBAA type node is null, the tag should be null too. Make sure we don't decorate an instruction with a null TBAA tag. Added a testing case for the bug reported by Richard with -relaxed-aliasing and -fsanitizer=thread. llvm-svn: 192145
15 lines
359 B
C++
15 lines
359 B
C++
// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s -fsanitize=thread -relaxed-aliasing -O1 | FileCheck %s
|
|
|
|
// Make sure we do not crash when relaxed-aliasing is on.
|
|
// CHECK-NOT: !tbaa
|
|
struct iterator { void *node; };
|
|
|
|
struct pair {
|
|
iterator first;
|
|
pair(const iterator &a) : first(a) {}
|
|
};
|
|
|
|
void equal_range() {
|
|
(void)pair(iterator());
|
|
}
|