[PATCH] D34234: [ELF] Emit only one error if -z max-page-size without value
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 19 04:05:58 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL305679: [ELF] Emit only one error if -z max-page-size without value (authored by jhenderson).
Changed prior to commit:
https://reviews.llvm.org/D34234?vs=102652&id=103010#toc
Repository:
rL LLVM
https://reviews.llvm.org/D34234
Files:
lld/trunk/ELF/Driver.cpp
lld/trunk/test/ELF/invalid-z.s
Index: lld/trunk/test/ELF/invalid-z.s
===================================================================
--- lld/trunk/test/ELF/invalid-z.s
+++ lld/trunk/test/ELF/invalid-z.s
@@ -0,0 +1,9 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
+# RUN: not ld.lld %t.o -o %t -z max-page-size 2>&1 | FileCheck %s
+# CHECK: invalid max-page-size
+# CHECK-NOT: error
+
+.global _start
+_start:
+ nop
Index: lld/trunk/ELF/Driver.cpp
===================================================================
--- lld/trunk/ELF/Driver.cpp
+++ lld/trunk/ELF/Driver.cpp
@@ -301,7 +301,7 @@
for (auto *Arg : Args.filtered(OPT_z)) {
std::pair<StringRef, StringRef> KV = StringRef(Arg->getValue()).split('=');
if (KV.first == Key) {
- uint64_t Result;
+ uint64_t Result = Default;
if (!to_integer(KV.second, Result))
error("invalid " + Key + ": " + KV.second);
return Result;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34234.103010.patch
Type: text/x-patch
Size: 943 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170619/5a4865d9/attachment.bin>
More information about the llvm-commits
mailing list