[llvm] r198702 - Fix uninitialized variable warning in DataLayout.

Cameron McInally cameron.mcinally at nyu.edu
Tue Jan 7 11:51:38 PST 2014


Author: mcinally
Date: Tue Jan  7 13:51:38 2014
New Revision: 198702

URL: http://llvm.org/viewvc/llvm-project?rev=198702&view=rev
Log:
Fix uninitialized variable warning in DataLayout.

Modified:
    llvm/trunk/lib/IR/DataLayout.cpp

Modified: llvm/trunk/lib/IR/DataLayout.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DataLayout.cpp?rev=198702&r1=198701&r2=198702&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DataLayout.cpp (original)
+++ llvm/trunk/lib/IR/DataLayout.cpp Tue Jan  7 13:51:38 2014
@@ -205,9 +205,9 @@ static std::pair<StringRef, StringRef> s
   return Split;
 }
 
-/// Get an unsinged integer, including error checks.
+/// Get an unsigned integer, including error checks.
 static unsigned getInt(StringRef R) {
-  unsigned Result;
+  unsigned Result = 0;
   bool error = R.getAsInteger(10, Result); (void)error;
   assert(!error && "not a number, or does not fit in an unsigned int");
   return Result;





More information about the llvm-commits mailing list