[PATCH] D125784: [llvm-debuginfo-analyzer] 09 - CodeView Reader

Carlos Alberto Enciso via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 14 05:33:28 PDT 2022


CarlosAlbertoEnciso added inline comments.


================
Comment at: llvm/lib/DebugInfo/LogicalView/Readers/LVCodeViewReader.cpp:132
+  if (resolveSymbolName(CoffSection, RelocOffset, Symbol))
+    *RelocSym = "";
+}
----------------
probinson wrote:
> `RelocSym` might be null (checked above).
Good finding.


================
Comment at: llvm/lib/DebugInfo/LogicalView/Readers/LVCodeViewVisitor.cpp:259
+    LVStringRefs::size_type FirstNamespace = 0;
+    LVStringRefs::size_type FirstNonNamespace = Components.size() - 1;
+    for (LVStringRefs::size_type Index = 0; Index < Components.size();
----------------
probinson wrote:
> `FirstNonNamespace` will be set to 0 on the first iteration of the loop, which cannot be a zero-trip loop because we know `Components.size()` is nonzero.  So this initialization is dead.
Good finding. Removed the initialization.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125784/new/

https://reviews.llvm.org/D125784



More information about the llvm-commits mailing list