OSDN Git Service

[llvm-cov] Silence a warning from the MSVC runtime (NFC)
authorVedant Kumar <vsk@apple.com>
Mon, 26 Sep 2016 17:57:13 +0000 (17:57 +0000)
committerVedant Kumar <vsk@apple.com>
Mon, 26 Sep 2016 17:57:13 +0000 (17:57 +0000)
commit64f3b51479d689f9f313d5ab4b621cd31376049f
tree119107ab1cd6c75c28e05f69745ed464c736a2b7
parentc9e7be5af9dd6de902646a4c5503f83162a60935
[llvm-cov] Silence a warning from the MSVC runtime (NFC)

Rework getLongestCommonPrefixLen() so that it doesn't access string null
terminators. The old version with std::mismatch would do this:

                        |
                        v
    Strings[0] = ['a', nil]

    Strings[1] = ['a', 'a', nil]
                        ^
                        |

This should silence a warning from the MSVC runtime (PR30515). As
before, I tested this out by preparing a coverage report for FileCheck.
Thanks to Yaron Keren for the report!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282422 91177308-0d34-0410-b5e6-96231b3b80d8
tools/llvm-cov/CoverageReport.cpp