summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2017-05-03 15:41:16 +0000
committerAlex Lorenz <arphaman@gmail.com>2017-05-03 15:41:16 +0000
commitd7dfec818b372b8e5d9addd0d2f224e824283d03 (patch)
tree0c8fab6cf54c8d15bc3caa32cedd498f01c4cd20 /clang/lib
parentd10df49c90fd0229c2364b119aebeba412b6bed0 (diff)
downloadbcm5719-llvm-d7dfec818b372b8e5d9addd0d2f224e824283d03.tar.gz
bcm5719-llvm-d7dfec818b372b8e5d9addd0d2f224e824283d03.zip
DiagnosticsEngine should clear DelayedDiagID before reporting the
delayed diagnostic This avoids an infinite loop that was uncovered in one of our internal tests by r301992. The testcase is the most reduced version of that auto-generated test. rdar://31962618 llvm-svn: 302037
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Basic/Diagnostic.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp
index 6bdef78c074..2cd400dbd71 100644
--- a/clang/lib/Basic/Diagnostic.cpp
+++ b/clang/lib/Basic/Diagnostic.cpp
@@ -146,8 +146,9 @@ void DiagnosticsEngine::SetDelayedDiagnostic(unsigned DiagID, StringRef Arg1,
}
void DiagnosticsEngine::ReportDelayed() {
- Report(DelayedDiagID) << DelayedDiagArg1 << DelayedDiagArg2;
+ unsigned ID = DelayedDiagID;
DelayedDiagID = 0;
+ Report(ID) << DelayedDiagArg1 << DelayedDiagArg2;
DelayedDiagArg1.clear();
DelayedDiagArg2.clear();
}
OpenPOWER on IntegriCloud