forked from OSchip/llvm-project
[llvm-config] Fix obviously wrong code in parsing DyLib components.
The code parsing the string was using the offset returned from StringRef::find() wrong, assuming it was relative to the staring offset that is passed to the function, but the returned offset is always relative to the beginning of the line. This causes odd behaviour while parsing the component string. Spotted thanks to the newly added test: tools/llvm-config/booleans.test llvm-svn: 291803
This commit is contained in:
parent
6684aeb137
commit
a5f1ff1afa
|
@ -242,7 +242,7 @@ std::vector<std::string> GetAllDyLibComponents(const bool IsInDevelopmentTree,
|
|||
size_t Offset = 0;
|
||||
while (true) {
|
||||
const size_t NextOffset = DyLibComponentsStr.find(';', Offset);
|
||||
DyLibComponents.push_back(DyLibComponentsStr.substr(Offset, NextOffset));
|
||||
DyLibComponents.push_back(DyLibComponentsStr.substr(Offset, NextOffset-Offset));
|
||||
if (NextOffset == std::string::npos) {
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue