================
@@ -57,11 +57,15 @@ static void ForEachFormatterInModule(
       cursor.seek(cursor.tell() - 1);
       break;
     }
+    if (!cursor || cursor.tell() >= section_size)
+      break;
----------------
Michael137 wrote:

The idiomatic way of iterating through the entirety of a `DataExtractor` is to 
check `section.eof(cursor)` in all the places where we explicitly check against 
section_size. And the padding skipping should just be a separate loop before we 
actually start reading the data. Then we wouldn't need an extra check here.

So could we just move the padding loop out? (and use `eof` checks, but that's 
optional).

https://github.com/llvm/llvm-project/pull/140139
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to