[llvm] r196623 - Fix a narrowing warning due to a type mismatch (size_t vs uint64).

Kaelyn Uhrain rikka at google.com
Fri Dec 6 15:09:24 PST 2013


Author: rikka
Date: Fri Dec  6 17:09:24 2013
New Revision: 196623

URL: http://llvm.org/viewvc/llvm-project?rev=196623&view=rev
Log:
Fix a narrowing warning due to a type mismatch (size_t vs uint64).

lib/Transforms/Instrumentation/AddressSanitizer.cpp:1405:36: error: non-constant-expression cannot be narrowed from type 'uint64_t' (aka 'unsigned long long') to 'size_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]
    getAllocaSizeInBytes(AI),
    ^~~~~~~~~~~~~~~~~~~~~~~~

Modified:
    llvm/trunk/include/llvm/Transforms/Utils/ASanStackFrameLayout.h

Modified: llvm/trunk/include/llvm/Transforms/Utils/ASanStackFrameLayout.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/ASanStackFrameLayout.h?rev=196623&r1=196622&r2=196623&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/Utils/ASanStackFrameLayout.h (original)
+++ llvm/trunk/include/llvm/Transforms/Utils/ASanStackFrameLayout.h Fri Dec  6 17:09:24 2013
@@ -29,7 +29,7 @@ static const int kAsanStackRightRedzoneM
 struct ASanStackVariableDescription {
   const char *Name;  // Name of the variable that will be displayed by asan
                      // if a stack-related bug is reported.
-  size_t Size;       // Size of the variable in bytes.
+  uint64_t Size;     // Size of the variable in bytes.
   size_t Alignment;  // Alignment of the variable (power of 2).
   AllocaInst *AI;    // The actual AllocaInst.
   size_t Offset;     // Offset from the beginning of the frame;





More information about the llvm-commits mailing list