[PATCH] D82200: [ADT] Fix itostr handling of min int64_t value

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 19 10:53:42 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGf3e8f9617365: [ADT] Fix itostr handling of min int64_t value (authored by thopre).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82200

Files:
  llvm/include/llvm/ADT/StringExtras.h


Index: llvm/include/llvm/ADT/StringExtras.h
===================================================================
--- llvm/include/llvm/ADT/StringExtras.h
+++ llvm/include/llvm/ADT/StringExtras.h
@@ -245,7 +245,7 @@
 
 inline std::string itostr(int64_t X) {
   if (X < 0)
-    return utostr(static_cast<uint64_t>(-X), true);
+    return utostr(-static_cast<uint64_t>(X), true);
   else
     return utostr(static_cast<uint64_t>(X));
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82200.272140.patch
Type: text/x-patch
Size: 433 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200619/116c945e/attachment.bin>


More information about the llvm-commits mailing list