[Lldb-commits] [PATCH] D22211: Change the /proc/<pid>/maps to not assert on incorrect input

Tamas Berghammer via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 11 06:50:48 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL275060: Change the /proc/<pid>/maps to not assert on incorrect input (authored by tberghammer).

Changed prior to commit:
  http://reviews.llvm.org/D22211?vs=63485&id=63503#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D22211

Files:
  lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp

Index: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
===================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -1919,31 +1919,28 @@
     const char read_perm_char = line_extractor.GetChar ();
     if (read_perm_char == 'r')
         memory_region_info.SetReadable (MemoryRegionInfo::OptionalBool::eYes);
-    else
-    {
-        assert ( (read_perm_char == '-') && "unexpected /proc/{pid}/maps read permission char" );
+    else if (read_perm_char == '-')
         memory_region_info.SetReadable (MemoryRegionInfo::OptionalBool::eNo);
-    }
+    else
+        return Error ("unexpected /proc/{pid}/maps read permission char");
 
     // Handle write permission.
     const char write_perm_char = line_extractor.GetChar ();
     if (write_perm_char == 'w')
         memory_region_info.SetWritable (MemoryRegionInfo::OptionalBool::eYes);
-    else
-    {
-        assert ( (write_perm_char == '-') && "unexpected /proc/{pid}/maps write permission char" );
+    else if (write_perm_char == '-')
         memory_region_info.SetWritable (MemoryRegionInfo::OptionalBool::eNo);
-    }
+    else
+        return Error ("unexpected /proc/{pid}/maps write permission char");
 
     // Handle execute permission.
     const char exec_perm_char = line_extractor.GetChar ();
     if (exec_perm_char == 'x')
         memory_region_info.SetExecutable (MemoryRegionInfo::OptionalBool::eYes);
-    else
-    {
-        assert ( (exec_perm_char == '-') && "unexpected /proc/{pid}/maps exec permission char" );
+    else if (exec_perm_char == '-')
         memory_region_info.SetExecutable (MemoryRegionInfo::OptionalBool::eNo);
-    }
+    else
+        return Error ("unexpected /proc/{pid}/maps exec permission char");
 
     return Error ();
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22211.63503.patch
Type: text/x-patch
Size: 1896 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160711/36330a5d/attachment.bin>


More information about the lldb-commits mailing list