llvm.org GIT mirror llvm / eea6148
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291803 91177308-0d34-0410-b5e6-96231b3b80d8 Marcello Maggioni 2 years ago
1 changed file(s) with 1 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
241241 size_t Offset = 0;
242242 while (true) {
243243 const size_t NextOffset = DyLibComponentsStr.find(';', Offset);
244 DyLibComponents.push_back(DyLibComponentsStr.substr(Offset, NextOffset));
244 DyLibComponents.push_back(DyLibComponentsStr.substr(Offset, NextOffset-Offset));
245245 if (NextOffset == std::string::npos) {
246246 break;
247247 }