aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-27 05:34:03 +0000
committerChris Lattner <sabre@nondot.org>2009-01-27 05:34:03 +0000
commit202fd2c4fb8d98ea9990df9bc157b11bc26ac2fa (patch)
tree1f3d795e1ad6a3e3be8d94ed8f08c3c6c7a9dc7f
parent08c375cd52b8f6b6a6915a2007205bc8179f41e9 (diff)
Fix a bug that I noticed by inspection.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63094 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Lex/PPDirectives.cpp1
-rw-r--r--test/Preprocessor/skipping_unclean.c9
2 files changed, 10 insertions, 0 deletions
diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp
index 4bf012c1b1..d277ec9dd4 100644
--- a/lib/Lex/PPDirectives.cpp
+++ b/lib/Lex/PPDirectives.cpp
@@ -219,6 +219,7 @@ void Preprocessor::SkipExcludedConditionalBlock(SourceLocation IfTokenLoc,
}
memcpy(Directive, &DirectiveStr[0], IdLen);
Directive[IdLen] = 0;
+ FirstChar = Directive[0];
}
if (FirstChar == 'i' && Directive[1] == 'f') {
diff --git a/test/Preprocessor/skipping_unclean.c b/test/Preprocessor/skipping_unclean.c
new file mode 100644
index 0000000000..9efdd648b4
--- /dev/null
+++ b/test/Preprocessor/skipping_unclean.c
@@ -0,0 +1,9 @@
+// RUN: clang -E %s | grep bark
+
+#if 0
+blah
+#\
+else
+bark
+#endif
+