[PATCH] D155093: [DWARF] Fix undefined behaviour in dwarf type printer
Maurice Heumann via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 12 22:55:50 PDT 2023
momo5502 updated this revision to Diff 539851.
momo5502 added a comment.
Remove to_string usages
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D155093/new/
https://reviews.llvm.org/D155093
Files:
llvm/lib/DebugInfo/DWARF/DWARFTypePrinter.cpp
Index: llvm/lib/DebugInfo/DWARF/DWARFTypePrinter.cpp
===================================================================
--- llvm/lib/DebugInfo/DWARF/DWARFTypePrinter.cpp
+++ llvm/lib/DebugInfo/DWARF/DWARFTypePrinter.cpp
@@ -424,11 +424,11 @@
OS << (char)Val;
OS << "'";
} else if (Val < 256)
- OS << to_string(llvm::format("'\\x%02x'", Val));
+ OS << llvm::format("'\\x%02" PRIx64 "'", Val);
else if (Val <= 0xFFFF)
- OS << to_string(llvm::format("'\\u%04x'", Val));
+ OS << llvm::format("'\\u%04" PRIx64 "'", Val);
else
- OS << to_string(llvm::format("'\\U%08x'", Val));
+ OS << llvm::format("'\\U%08" PRIx64 "'", Val);
}
}
continue;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155093.539851.patch
Type: text/x-patch
Size: 784 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230713/40b8d1d5/attachment.bin>
More information about the llvm-commits
mailing list