[llvm] 3db3e2c - [llvm] Silence warning when compiling with MSVC targetting x86

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 25 06:34:35 PST 2024


Author: Alexandre Ganea
Date: 2024-01-25T09:34:18-05:00
New Revision: 3db3e2cea321aba58fcf1905e06a92567e892588

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

LOG: [llvm] Silence warning when compiling with MSVC targetting x86

This fixes:
```
[1265/6998] Building CXX object lib\Object\CMakeFiles\LLVMObject.dir\DXContainer.cpp.obj
C:\git\llvm-project\llvm\lib\Object\DXContainer.cpp(344): warning C4018: '<': signed/unsigned mismatch
```

Added: 
    

Modified: 
    llvm/lib/Object/DXContainer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Object/DXContainer.cpp b/llvm/lib/Object/DXContainer.cpp
index 4aabe9cea3e577e..0401c20b98ec8e8 100644
--- a/llvm/lib/Object/DXContainer.cpp
+++ b/llvm/lib/Object/DXContainer.cpp
@@ -341,7 +341,8 @@ Error DirectX::PSVRuntimeInfo::parse(uint16_t ShaderKind) {
     SigOutputElements.Stride = SigPatchOrPrimElements.Stride =
         SigInputElements.Stride;
 
-    if (Data.end() - Current < ElementCount * SigInputElements.Stride)
+    if (Data.end() - Current <
+        (ptr
diff _t)(ElementCount * SigInputElements.Stride))
       return parseFailed(
           "Signature elements extend beyond the size of the part");
 


        


More information about the llvm-commits mailing list