[PATCH] D21894: [ELF] - Fixed incorrect logic of version assignments when mixing wildcards with values matching.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 6 23:45:01 PDT 2016


grimar added inline comments.

================
Comment at: ELF/SymbolTable.cpp:603
@@ +602,3 @@
+
+  for (size_t I = Config->SymbolVersions.size() - 1; I != (size_t)-1; --I) {
+    Version &V = Config->SymbolVersions[I];
----------------
ruiu wrote:
>   I >= 0
This will not work. If for Config->SymbolVersions.size() == 1, for example,
first iteration will pass, but then since "I" is unsigned it will be equal 0xffffffff and loop will continue,
when it should terminate.
Changing to "I > 0" will not work as expected either.


http://reviews.llvm.org/D21894





More information about the llvm-commits mailing list