forked from OSchip/llvm-project
ToolChains: Minor touchup to use correct type, avoid truncation.
Truncation happens regularly when find_first_not_of returns npos, strings long enough to trigger bug here are implausible. No functionality change intended (ignoring absurd string lengths). llvm-svn: 172127
This commit is contained in:
parent
54c3907484
commit
a38608b43f
|
@ -952,7 +952,7 @@ Generic_GCC::GCCVersion Linux::GCCVersion::Parse(StringRef VersionText) {
|
|||
// And retains any patch number it finds.
|
||||
StringRef PatchText = GoodVersion.PatchSuffix = Second.second.str();
|
||||
if (!PatchText.empty()) {
|
||||
if (unsigned EndNumber = PatchText.find_first_not_of("0123456789")) {
|
||||
if (size_t EndNumber = PatchText.find_first_not_of("0123456789")) {
|
||||
// Try to parse the number and any suffix.
|
||||
if (PatchText.slice(0, EndNumber).getAsInteger(10, GoodVersion.Patch) ||
|
||||
GoodVersion.Patch < 0)
|
||||
|
|
Loading…
Reference in New Issue