Index: lld/trunk/Common/Args.cpp =================================================================== --- lld/trunk/Common/Args.cpp +++ lld/trunk/Common/Args.cpp @@ -26,12 +26,13 @@ return CodeGenOpt::Default; } -int lld::args::getInteger(opt::InputArgList &Args, unsigned Key, int Default) { +int64_t lld::args::getInteger(opt::InputArgList &Args, unsigned Key, + int64_t Default) { auto *A = Args.getLastArg(Key); if (!A) return Default; - int V; + int64_t V; if (to_integer(A->getValue(), V, 10)) return V; Index: lld/trunk/include/lld/Common/Args.h =================================================================== --- lld/trunk/include/lld/Common/Args.h +++ lld/trunk/include/lld/Common/Args.h @@ -25,7 +25,8 @@ llvm::CodeGenOpt::Level getCGOptLevel(int OptLevelLTO); -int getInteger(llvm::opt::InputArgList &Args, unsigned Key, int Default); +int64_t getInteger(llvm::opt::InputArgList &Args, unsigned Key, + int64_t Default); std::vector getStrings(llvm::opt::InputArgList &Args, int Id); Index: lld/trunk/test/wasm/large-memory.test =================================================================== --- lld/trunk/test/wasm/large-memory.test +++ lld/trunk/test/wasm/large-memory.test @@ -0,0 +1,5 @@ +RUN: llc -filetype=obj %p/Inputs/start.ll -o %t.o + +; Verify we can parse large integers such as when we ask for 2G of total +; memory. +RUN: wasm-ld %t.o -o %t.wasm --max-memory=2147483648