]> granicus.if.org Git - clang/commitdiff
Fix a bug that I noticed by inspection.
authorChris Lattner <sabre@nondot.org>
Tue, 27 Jan 2009 05:34:03 +0000 (05:34 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 27 Jan 2009 05:34:03 +0000 (05:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63094 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/PPDirectives.cpp
test/Preprocessor/skipping_unclean.c [new file with mode: 0644]

index 4bf012c1b119a49cc2831e047793ef6c33d09ca9..d277ec9dd47cb9bdbaf3e0c7421f48208351df9e 100644 (file)
@@ -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 (file)
index 0000000..9efdd64
--- /dev/null
@@ -0,0 +1,9 @@
+// RUN: clang -E %s | grep bark
+
+#if 0
+blah
+#\
+else
+bark
+#endif
+