[PATCH] D121752: [Debuginfod] Fix overflow warning on 32-bit hosts.

Daniel Thornburgh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 15 16:20:17 PDT 2022


mysterymath created this revision.
mysterymath added reviewers: phosek, MaskRay.
Herald added a project: All.
mysterymath requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The inserted cast is a no-op.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121752

Files:
  llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h


Index: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h
===================================================================
--- llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h
+++ llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h
@@ -62,9 +62,10 @@
     std::string FallbackDebugPath;
     std::string DWPName;
     std::vector<std::string> DebugFileDirectory;
-    size_t MaxCacheSize = sizeof(size_t) == 4
-                              ? 512 * 1024 * 1024 /* 512 MiB */
-                              : 4ULL * 1024 * 1024 * 1024 /* 4 GiB */;
+    size_t MaxCacheSize =
+        sizeof(size_t) == 4
+            ? 512 * 1024 * 1024 /* 512 MiB */
+            : static_cast<size_t>(4ULL * 1024 * 1024 * 1024) /* 4 GiB */;
   };
 
   LLVMSymbolizer();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121752.415623.patch
Type: text/x-patch
Size: 755 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220315/fa51d967/attachment.bin>


More information about the llvm-commits mailing list