]> granicus.if.org Git - clang/commitdiff
Driver: Fix off by one in ParseOneArg; this code is ugly but will be
authorDaniel Dunbar <daniel@zuster.org>
Wed, 4 Mar 2009 23:03:35 +0000 (23:03 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 4 Mar 2009 23:03:35 +0000 (23:03 +0000)
replaced anyway.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66101 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/OptTable.cpp

index 284e3ba1e299a23c616131e452db37c6dacc3086..5de71d763339ff22b4064e6b7806ce71fdb202b1 100644 (file)
@@ -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;
   }