summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2015-02-27 03:12:19 +0000
committerAnna Zaks <ganna@apple.com>2015-02-27 03:12:19 +0000
commit2249049db2d0341a037da92c25f141db7ceea6d8 (patch)
tree1d75096068743a2d8bac42c0bac1c8ff7e6ff662 /compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
parent5bc883f39ebab81b54629feebc7da6b6d5e2b8aa (diff)
downloadbcm5719-llvm-2249049db2d0341a037da92c25f141db7ceea6d8.tar.gz
bcm5719-llvm-2249049db2d0341a037da92c25f141db7ceea6d8.zip
[compiler-rt] Allow suppression file to be relative to the location of the executable
The ASanified executable could be launched from different locations. When we cannot find the suppression file relative to the current directory, try to see if the specified path is relative to the location of the executable. llvm-svn: 230723
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_posix.cc')
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_posix.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc b/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
index 5bc41c2580f..b8bd1b2b8e5 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
@@ -293,6 +293,14 @@ char *FindPathToBinary(const char *name) {
return 0;
}
+bool IsPathSeparator(const char c) {
+ return c == '/';
+}
+
+bool IsAbsolutePath(const char *path) {
+ return path != nullptr && IsPathSeparator(path[0]);
+}
+
void ReportFile::Write(const char *buffer, uptr length) {
SpinMutexLock l(mu);
static const char *kWriteError =
OpenPOWER on IntegriCloud