mirror of
https://github.com/intel/llvm.git
synced 2026-01-17 06:40:01 +08:00
Check the return of getInteger.
llvm-svn: 281608
This commit is contained in:
@@ -1307,7 +1307,8 @@ Expr ScriptParser::readPrimary() {
|
||||
next();
|
||||
expect(",");
|
||||
uint64_t Val;
|
||||
next().getAsInteger(0, Val);
|
||||
if (next().getAsInteger(0, Val))
|
||||
setError("integer expected");
|
||||
expect(")");
|
||||
return [=](uint64_t Dot) { return Val; };
|
||||
}
|
||||
|
||||
@@ -20,3 +20,8 @@
|
||||
.quad foobar2
|
||||
.quad foobar3
|
||||
.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
|
||||
|
||||
Reference in New Issue
Block a user