Driver: Fix off by one in ParseOneArg; this code is ugly but will be
replaced anyway. llvm-svn: 66101
This commit is contained in:
parent
135837e046
commit
b7396f10b9
|
@ -127,11 +127,11 @@ Arg *OptTable::ParseOneArg(const ArgList &Args, unsigned &Index,
|
|||
return new PositionalArg(getOption(InputOpt), Index++);
|
||||
|
||||
for (unsigned j = UnknownOpt + 1; j < getNumOptions(); ++j) {
|
||||
const char *OptName = getOptionName((options::ID) (j + 1));
|
||||
const char *OptName = getOptionName((options::ID) j);
|
||||
|
||||
// Arguments are only accepted by options which prefix them.
|
||||
if (memcmp(Str, OptName, strlen(OptName)) == 0)
|
||||
if (Arg *A = getOption((options::ID) (j + 1))->accept(Args, Index))
|
||||
if (Arg *A = getOption((options::ID) j)->accept(Args, Index))
|
||||
return A;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue