summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-06-27 23:45:44 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-06-27 23:45:44 +0000
commit92aae0f7a47943a3f75536a18e67beb6f649acd6 (patch)
tree142bc02b5fe07115fd1ddfb9b498b25ad87c596a /clang/lib
parent7e8729b904f8c45aa5ccc889c0987dcb5f9c9d95 (diff)
downloadbcm5719-llvm-92aae0f7a47943a3f75536a18e67beb6f649acd6.tar.gz
bcm5719-llvm-92aae0f7a47943a3f75536a18e67beb6f649acd6.zip
Fix uninitialized variable use bug found by the clairvoyant static analyzer.
Commit::canReplaceText would not initialize its out 'Len' parameter before returning true and it would be used uninitialized in Commit::replaceText. llvm-svn: 159306
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Edit/Commit.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Edit/Commit.cpp b/clang/lib/Edit/Commit.cpp
index c45ee1f850a..41c72e42e6a 100644
--- a/clang/lib/Edit/Commit.cpp
+++ b/clang/lib/Edit/Commit.cpp
@@ -332,6 +332,7 @@ bool Commit::canReplaceText(SourceLocation loc, StringRef text,
if (invalidTemp)
return false;
+ Len = text.size();
return file.substr(Offs.getOffset()).startswith(text);
}
OpenPOWER on IntegriCloud