diff options
| author | Daniel Jasper <djasper@google.com> | 2013-03-20 15:12:38 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2013-03-20 15:12:38 +0000 |
| commit | 1a32a61ad4aac06949f8750930eb353f72c59759 (patch) | |
| tree | d41f8e2e297742cf2de4dcb649b927f049b3aec2 /clang/lib/Format | |
| parent | 6120bac6e69be46c062ed6e8fe89dc916d18b82f (diff) | |
| download | bcm5719-llvm-1a32a61ad4aac06949f8750930eb353f72c59759.tar.gz bcm5719-llvm-1a32a61ad4aac06949f8750930eb353f72c59759.zip | |
Fix infinite-loop in unwrapped line parser.
Discovered when accidentally formatting a python file :-).
llvm-svn: 177527
Diffstat (limited to 'clang/lib/Format')
| -rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index 2ca44620c33..a01344c03e6 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -684,7 +684,7 @@ void UnwrappedLineParser::parseRecord() { // (this would still leave us with an ambiguity between template function // and class declarations). if (FormatTok.Tok.is(tok::colon) || FormatTok.Tok.is(tok::less)) { - while (FormatTok.Tok.isNot(tok::l_brace)) { + while (!eof() && FormatTok.Tok.isNot(tok::l_brace)) { if (FormatTok.Tok.is(tok::semi)) return; nextToken(); |

