[llvm] Fix compress/decompress in LLVM Offloading API (PR #150064)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 19 01:25:07 PDT 2025


================
@@ -333,13 +333,15 @@ CompressedOffloadBundle::compress(compression::Params P,
   if (Version == 2) {
     // For V2, ensure the sizes don't exceed 32-bit limit.
     if (UncompressedSize64 > std::numeric_limits<uint32_t>::max())
-      return createStringError(inconvertibleErrorCode(),
-                               "uncompressed size exceeds version 2 limit");
+      return createStringError(
+          inconvertibleErrorCode(),
+          "uncompressed size exceeds version 2 unsigned 32-bit integer limit");
     if ((MagicNumber.size() + sizeof(uint32_t) + sizeof(Version) +
          sizeof(CompressionMethod) + sizeof(uint32_t) + sizeof(TruncatedHash) +
          CompressedBuffer.size()) > std::numeric_limits<uint32_t>::max())
-      return createStringError(inconvertibleErrorCode(),
-                               "total file size exceeds version 2 limit");
+      return createStringError(
+          inconvertibleErrorCode(),
+          "total file size exceeds version 2 unsigned 32-bit integer limit");
----------------
jh7370 wrote:

As above, including the actual total file size in the message would be ideal.

https://github.com/llvm/llvm-project/pull/150064


More information about the llvm-commits mailing list