[compiler-rt] r196264 - [Sanitizer] Use more appropriate InternalScopedString in GetCodeRangeForFile

Alexey Samsonov samsonov at google.com
Tue Dec 3 01:29:23 PST 2013


Author: samsonov
Date: Tue Dec  3 03:29:23 2013
New Revision: 196264

URL: http://llvm.org/viewvc/llvm-project?rev=196264&view=rev
Log:
[Sanitizer] Use more appropriate InternalScopedString in GetCodeRangeForFile

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc?rev=196264&r1=196263&r2=196264&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc Tue Dec  3 03:29:23 2013
@@ -230,12 +230,11 @@ void RawWrite(const char *buffer) {
 
 bool GetCodeRangeForFile(const char *module, uptr *start, uptr *end) {
   uptr s, e, off, prot;
-  InternalMmapVector<char> fn(4096);
-  fn.push_back(0);
+  InternalScopedString buff(4096);
   MemoryMappingLayout proc_maps(/*cache_enabled*/false);
-  while (proc_maps.Next(&s, &e, &off, &fn[0], fn.capacity(), &prot)) {
+  while (proc_maps.Next(&s, &e, &off, buff.data(), buff.size(), &prot)) {
     if ((prot & MemoryMappingLayout::kProtectionExecute) != 0
-        && internal_strcmp(module, &fn[0]) == 0) {
+        && internal_strcmp(module, buff.data()) == 0) {
       *start = s;
       *end = e;
       return true;





More information about the llvm-commits mailing list