Skip to content

Commit

Permalink
hwasan: Use C++ driver for cfi.cc test.
Browse files Browse the repository at this point in the history
It turns out that this test was only passing by accident. It was relying on
the optimizer to remove the only reference to A's vtable by realizing that
the CFI check will always fail. The vtable contains a reference to RTTI in
libc++, which will be unresolved because the C driver won't link against it.

This was found by my prototype implementation of HWASAN for globals, which
happens to end up preserving the reference.

Differential Revision: https://reviews.llvm.org/D64890

llvm-svn: 366389
  • Loading branch information
pcc committed Jul 17, 2019
1 parent 6abd78c commit 749f556
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler-rt/test/hwasan/TestCases/cfi.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_hwasan -fsanitize=cfi -fno-sanitize-trap=cfi -flto -fvisibility=hidden -fuse-ld=lld %s -o %t
// RUN: %clangxx_hwasan -fsanitize=cfi -fno-sanitize-trap=cfi -flto -fvisibility=hidden -fuse-ld=lld %s -o %t
// RUN: not %run %t 2>&1 | FileCheck %s

// REQUIRES: android
Expand Down

0 comments on commit 749f556

Please sign in to comment.