[PATCH] D155093: [DWARF] Fix undefined behaviour in dwarf type printer

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 12 12:04:54 PDT 2023


efriedma accepted this revision.
efriedma added a comment.
This revision is now accepted and ready to land.

LGTM

Longer term, we should consider what we can do to mitigate this sort of issue showing up again (adding a "format" attribute to llvm::format and/or switching more code over to other formatting functions like llvm::formatv).



================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFTypePrinter.cpp:431
           else
-            OS << to_string(llvm::format("'\\U%08x'", Val));
+            OS << to_string(llvm::format("'\\U%08" PRIx64 "'", Val));
         }
----------------
Not really related to this change, but while you're here, can you drop the to_string calls?  `OS << llvm::format()` should just work.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155093



More information about the llvm-commits mailing list