[Symbolize] Fix overflow warning on 32-bit hosts.
authorDaniel Thornburgh <dthorn@google.com>
Tue, 15 Mar 2022 23:18:42 +0000 (23:18 +0000)
committerDaniel Thornburgh <dthorn@google.com>
Wed, 16 Mar 2022 16:44:36 +0000 (16:44 +0000)
The inserted cast is a no-op.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D121752

llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h

index 007c5f4..00c4bf0 100644 (file)
@@ -62,9 +62,10 @@ public:
     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();