Index: ELF/Driver.cpp =================================================================== --- ELF/Driver.cpp +++ ELF/Driver.cpp @@ -301,7 +301,7 @@ for (auto *Arg : Args.filtered(OPT_z)) { std::pair 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; Index: test/ELF/invalid-z.s =================================================================== --- test/ELF/invalid-z.s +++ 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