summaryrefslogtreecommitdiff
path: root/lib/IR
diff options
context:
space:
mode:
authorCameron McInally <cameron.mcinally@nyu.edu>2014-01-13 22:04:55 +0000
committerCameron McInally <cameron.mcinally@nyu.edu>2014-01-13 22:04:55 +0000
commit486fdf2e654c419f013d463abad4aef575b4c11b (patch)
tree34a3958e3defefd7e3946566a527406ef6198f31 /lib/IR
parentdf7e862802118f28a387fd7d054f97ac66ca89cd (diff)
downloadllvm-486fdf2e654c419f013d463abad4aef575b4c11b.tar.gz
llvm-486fdf2e654c419f013d463abad4aef575b4c11b.tar.bz2
llvm-486fdf2e654c419f013d463abad4aef575b4c11b.tar.xz
Fix uninitialized warning in llvm/lib/IR/DataLayout.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199147 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR')
-rw-r--r--lib/IR/DataLayout.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/IR/DataLayout.cpp b/lib/IR/DataLayout.cpp
index 7df867279b..7de41faac4 100644
--- a/lib/IR/DataLayout.cpp
+++ b/lib/IR/DataLayout.cpp
@@ -207,9 +207,10 @@ static std::pair<StringRef, StringRef> split(StringRef Str, char Separator) {
/// Get an unsigned integer, including error checks.
static unsigned getInt(StringRef R) {
- unsigned Result = 0;
+ unsigned Result;
bool error = R.getAsInteger(10, Result); (void)error;
- assert(!error && "not a number, or does not fit in an unsigned int");
+ if (error)
+ report_fatal_error("not a number, or does not fit in an unsigned int");
return Result;
}