[PATCH] Fix prefixes list initialization in driver::OptTable ctor

Mehdi AMINI mehdi.amini at silkan.com
Wed Apr 10 09:30:07 PDT 2013


Ping.

On 4/5/13 8:46 PM, Mehdi AMINI wrote:
> Hi,
>
> Please find attached a little bugfix for OptTable initialization of
> prefixes. The loop initializing the list of prefixes from the options
> list stops before the last entry. If the last entry in the options table
> uses a unique prefix, then it won't be parsed.
>
> Thanks,
>
> Mehdi
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>

-------------- next part --------------
diff --git a/lib/Driver/OptTable.cpp b/lib/Driver/OptTable.cpp
index 20214a6..a8ebfa1 100644
--- a/lib/Driver/OptTable.cpp
+++ b/lib/Driver/OptTable.cpp
@@ -132,8 +132,8 @@ OptTable::OptTable(const Info *_OptionInfos, unsigned _NumOptionInfos)
 #endif
 
   // Build prefixes.
-  for (unsigned i = FirstSearchableIndex+1, e = getNumOptions(); i != e; ++i) {
-    if (const char *const *P = getInfo(i).Prefixes) {
+  for (unsigned i = FirstSearchableIndex, e = getNumOptions(); i != e; ++i) {
+    if (const char *const *P = getInfo(i+1).Prefixes) {
       for (; *P != 0; ++P) {
         PrefixesUnion.insert(*P);
       }


More information about the cfe-commits mailing list