aboutsummaryrefslogtreecommitdiff
path: root/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-04-04 19:31:00 +0000
committerDaniel Jasper <djasper@google.com>2013-04-04 19:31:00 +0000
commitabfc9c160ad65e890b66480f3c52e9b5ef7bf4d8 (patch)
treedfd80850931b06210339db6c507e2681c914929f /lib/Format
parent740991bdf8bb2638ff111ae2084791c52c1cee00 (diff)
Fix bug discovered with address sanitizer.
Now, this works again with an empty stack. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178779 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format')
-rw-r--r--lib/Format/Format.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index 1e0178e14e..d6aa6a9b7e 100644
--- a/lib/Format/Format.cpp
+++ b/lib/Format/Format.cpp
@@ -927,11 +927,11 @@ private:
}
// Remove scopes created by fake parenthesis.
- unsigned VariablePos = State.Stack.back().VariablePos;
for (unsigned i = 0, e = Current.FakeRParens; i != e; ++i) {
+ unsigned VariablePos = State.Stack.back().VariablePos;
State.Stack.pop_back();
+ State.Stack.back().VariablePos = VariablePos;
}
- State.Stack.back().VariablePos = VariablePos;
if (Current.is(tok::string_literal)) {
State.StartOfStringLiteral = State.Column;