[llvm] [llvm-objdump][ELF]Fix crash when reading strings from .dynstr(#86612) (PR #125679)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 11 01:22:39 PST 2025


================
@@ -221,6 +224,20 @@ template <class ELFT> void ELFDumper<ELFT>::printDynamicSection() {
   std::string TagFmt = "  %-" + std::to_string(MaxLen) + "s ";
 
   outs() << "\nDynamic Section:\n";
+  auto StringTableSize = (typename ELFT::Xword)0;
----------------
jh7370 wrote:

Ah, the constructor is marked as `explicit`. Try this:
```
typename ELFT::Xword StringTableSize{0};
```
This worked locally for me with a Visual Studio build at least.

https://github.com/llvm/llvm-project/pull/125679


More information about the llvm-commits mailing list