[PATCH] Fix an invalid check for duplicate option categories.

Alexander Kornienko alexfh at google.com
Wed Feb 5 08:37:43 PST 2014



================
Comment at: lib/Support/CommandLine.cpp:1511
@@ -1497,5 +1510,3 @@
   static bool OptionCategoryCompare(OptionCategory *A, OptionCategory *B) {
-    int Length = strcmp(A->getName(), B->getName());
-    assert(Length != 0 && "Duplicate option categories");
-    return Length < 0;
+    return strcmp(A->getName(), B->getName());
   }
----------------
Alex McCarthy wrote:
> This used to return true if strcmp returned a negative value, but I think it now returns true for any non-zero return value. Is this correct, or should this be return strcmp() < 0?
Good catch! Thanks!


http://llvm-reviews.chandlerc.com/D2699



More information about the cfe-commits mailing list