[compiler-rt] r350104 - [asan] Fix build on windows.
Evgeniy Stepanov via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 27 14:16:28 PST 2018
Author: eugenis
Date: Thu Dec 27 14:16:28 2018
New Revision: 350104
URL: http://llvm.org/viewvc/llvm-project?rev=350104&view=rev
Log:
[asan] Fix build on windows.
Reviewers: vitalybuka
Subscribers: kubamracek, llvm-commits
Differential Revision: https://reviews.llvm.org/D56111
Modified:
compiler-rt/trunk/lib/asan/asan_thread.cc
Modified: compiler-rt/trunk/lib/asan/asan_thread.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_thread.cc?rev=350104&r1=350103&r2=350104&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_thread.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_thread.cc Thu Dec 27 14:16:28 2018
@@ -285,13 +285,21 @@ AsanThread *CreateMainThread() {
return main_thread;
}
+static bool StackLimitsAreAvailable() {
+#if SANITIZER_WINDOWS
+ return true;
+#else
+ return MemoryMappingLayout::IsAvailable();
+#endif
+}
+
// This implementation doesn't use the argument, which is just passed down
// from the caller of Init (which see, above). It's only there to support
// OS-specific implementations that need more information passed through.
void AsanThread::SetThreadStackAndTls(const InitOptions *options) {
DCHECK_EQ(options, nullptr);
// If this process is "init" (pid 1), /proc may not be mounted yet.
- if (!start_routine_ && !MemoryMappingLayout::IsAvailable()) {
+ if (!start_routine_ && !StackLimitsAreAvailable()) {
stack_top_ = stack_bottom_ = 0;
tls_begin_ = tls_end_ = 0;
} else {
More information about the llvm-commits
mailing list