Check the return of getInteger.

llvm-svn: 281608
This commit is contained in:
Rafael Espindola 2016-09-15 13:36:44 +00:00
parent 2f9bb1627a
commit 3adbbc3891
2 changed files with 7 additions and 1 deletions

View File

@ -1307,7 +1307,8 @@ Expr ScriptParser::readPrimary() {
next(); next();
expect(","); expect(",");
uint64_t Val; uint64_t Val;
next().getAsInteger(0, Val); if (next().getAsInteger(0, Val))
setError("integer expected");
expect(")"); expect(")");
return [=](uint64_t Dot) { return Val; }; return [=](uint64_t Dot) { return Val; };
} }

View File

@ -20,3 +20,8 @@
.quad foobar2 .quad foobar2
.quad foobar3 .quad foobar3
.quad foobar4 .quad foobar4
// RUN: echo "SECTIONS { . = SEGMENT_START(\"foobar\", foo); }" > %t.script
// RUN: not ld.lld %t.o %t.script -shared -o %t2.so 2>&1 \
// RUN: | FileCheck --check-prefix=ERR %s
// ERR: integer expected