Fix memory-smashing logic error in dependency file generation.

Accessed the wrong array...

Swift SVN r18535
This commit is contained in:
Jordan Rose
2014-05-21 23:33:51 +00:00
parent 6c6b6845a9
commit 770a3dda3b
4 changed files with 4 additions and 1 deletions

View File

@@ -36,7 +36,7 @@ void DependencyFileGenerator::writeToStream(llvm::raw_ostream &os) const {
for (auto index = raw.find_first_of(badChars); index != StringRef::npos;
index = raw.find_first_of(badChars, index+1)) {
pathBuf.append(raw.slice(prev, index));
if (pathBuf[index] == '$')
if (raw[index] == '$')
pathBuf.push_back('$');
else
pathBuf.push_back('\\');