summaryrefslogtreecommitdiff
path: root/lib/asan/asan_linux.cc
diff options
context:
space:
mode:
authorFrancis Ricci <francisjricci@gmail.com>2017-07-11 18:54:00 +0000
committerFrancis Ricci <francisjricci@gmail.com>2017-07-11 18:54:00 +0000
commit26482612ad1935ba0eff838325b4d254942f2b9d (patch)
treeb24deadc845e47b487e9acf6ff4eee407edd086c /lib/asan/asan_linux.cc
parent093a9f1fc68d3adff00f60983971bd1893907298 (diff)
Refactor MemoryMappingLayout::Next to use a single struct instead of output parameters. NFC.
Summary: This is the first in a series of patches to refactor sanitizer_procmaps to allow MachO section information to be exposed on darwin. In addition, grouping all segment information in a single struct is cleaner than passing it through a large set of output parameters, and avoids the need for annotations of NULL parameters for unneeded information. The filename string is optional and must be managed and supplied by the calling function. This is to allow the MemoryMappedSegment struct to be stored on the stack without causing overly large stack sizes. Reviewers: alekseyshl, kubamracek, glider Subscribers: emaste, llvm-commits Differential Revision: https://reviews.llvm.org/D35135 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307688 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_linux.cc')
-rw-r--r--lib/asan/asan_linux.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/asan/asan_linux.cc b/lib/asan/asan_linux.cc
index 50ef84c39..b546bc1a6 100644
--- a/lib/asan/asan_linux.cc
+++ b/lib/asan/asan_linux.cc
@@ -140,9 +140,9 @@ void AsanCheckIncompatibleRT() {
// system libraries, causing crashes later in ASan initialization.
MemoryMappingLayout proc_maps(/*cache_enabled*/true);
char filename[128];
- while (proc_maps.Next(nullptr, nullptr, nullptr, filename,
- sizeof(filename), nullptr)) {
- if (IsDynamicRTName(filename)) {
+ MemoryMappedSegment segment(filename, sizeof(filename));
+ while (proc_maps.Next(&segment)) {
+ if (IsDynamicRTName(segment.filename)) {
Report("Your application is linked against "
"incompatible ASan runtimes.\n");
Die();