Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 486fdf2

Browse files
committed
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
1 parent df7e862 commit 486fdf2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/IR/DataLayout.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,10 @@ static std::pair<StringRef, StringRef> split(StringRef Str, char Separator) {
207207

208208
/// Get an unsigned integer, including error checks.
209209
static unsigned getInt(StringRef R) {
210-
unsigned Result = 0;
210+
unsigned Result;
211211
bool error = R.getAsInteger(10, Result); (void)error;
212-
assert(!error && "not a number, or does not fit in an unsigned int");
212+
if (error)
213+
report_fatal_error("not a number, or does not fit in an unsigned int");
213214
return Result;
214215
}
215216

test/Assembler/getInt.ll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
; RUN: opt < %s
2+
; XFAIL: *
3+
4+
target datalayout = "p:4294967296:64:64"

0 commit comments

Comments
 (0)