aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Lex/Preprocessor.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Lex/Preprocessor.h')
-rw-r--r--include/clang/Lex/Preprocessor.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h
index 2184acf0e3..5b9959c32a 100644
--- a/include/clang/Lex/Preprocessor.h
+++ b/include/clang/Lex/Preprocessor.h
@@ -241,7 +241,8 @@ public:
/// it.
PPCallbacks *getPPCallbacks() const { return Callbacks; }
void setPPCallbacks(PPCallbacks *C) {
- delete Callbacks;
+ if (Callbacks)
+ C = new PPChainedCallbacks(C, Callbacks);
Callbacks = C;
}