diff options
author | Daniel Jasper <djasper@google.com> | 2016-09-17 07:20:36 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2016-09-17 07:20:36 +0000 |
commit | 72aeae9a2f042f160e700b97fde61be3e0adc133 (patch) | |
tree | 1115452497e0558946e20cd48a6ffae98a69451e /lib/Format/FormatTokenLexer.cpp | |
parent | 028c96e26e17ac085fab03b5b02dafec8f9218cf (diff) |
clang-format: [JS] Fix a crash in handledTemplateStrings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281816 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/FormatTokenLexer.cpp')
-rw-r--r-- | lib/Format/FormatTokenLexer.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Format/FormatTokenLexer.cpp b/lib/Format/FormatTokenLexer.cpp index 8c795fb4d6..c9670aeff6 100644 --- a/lib/Format/FormatTokenLexer.cpp +++ b/lib/Format/FormatTokenLexer.cpp @@ -235,6 +235,8 @@ void FormatTokenLexer::handleTemplateStrings() { return; } if (BacktickToken->is(tok::r_brace)) { + if (StateStack.size() == 1) + return; StateStack.pop(); if (StateStack.top() != LexerState::TEMPLATE_STRING) return; |