[clang] cfad8f1 - [clang][bytecode] Fix a build failure on aarch64

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 12 00:08:40 PST 2024


Author: Timm Bäder
Date: 2024-12-12T09:08:30+01:00
New Revision: cfad8f14f846860b5c2e413c41c9b2b56466662e

URL: https://github.com/llvm/llvm-project/commit/cfad8f14f846860b5c2e413c41c9b2b56466662e
DIFF: https://github.com/llvm/llvm-project/commit/cfad8f14f846860b5c2e413c41c9b2b56466662e.diff

LOG: [clang][bytecode] Fix a build failure on aarch64

This broke e.g.
https://lab.llvm.org/buildbot/#/builders/190/builds/11216

Added: 
    

Modified: 
    clang/lib/AST/ByteCode/InterpBuiltin.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ByteCode/InterpBuiltin.cpp b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
index 68b6929423e344..a343280b5ce50f 100644
--- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp
+++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
@@ -1950,7 +1950,8 @@ static bool interp__builtin_memcmp(InterpState &S, CodePtr OpPC,
 
   size_t MinBufferSize = std::min(BufferA.byteSize().getQuantity(),
                                   BufferB.byteSize().getQuantity());
-  size_t CmpSize = std::min(MinBufferSize, Size.getZExtValue());
+  size_t CmpSize =
+      std::min(MinBufferSize, static_cast<size_t>(Size.getZExtValue()));
   int Result = std::memcmp(BufferA.Data.get(), BufferB.Data.get(), CmpSize);
   if (Result == 0)
     pushInteger(S, 0, Call->getType());


        


More information about the cfe-commits mailing list