summaryrefslogtreecommitdiffstats
path: root/clang/test/Index
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2017-07-07 10:25:12 +0000
committerAlex Lorenz <arphaman@gmail.com>2017-07-07 10:25:12 +0000
commit5ff6b8655a3f7b0b23dba272a3dc0c9add82897b (patch)
tree111342eca0af9c2f4c0119251182ab6cc571b129 /clang/test/Index
parent66a6d0146a90d12d1e3c857aad69fec01f3099d1 (diff)
downloadbcm5719-llvm-5ff6b8655a3f7b0b23dba272a3dc0c9add82897b.tar.gz
bcm5719-llvm-5ff6b8655a3f7b0b23dba272a3dc0c9add82897b.zip
[Frontend] Verify that the bitstream is not empty before reading
the serialised diagnostics Clang should avoid calling report_fatal_error when the file with the serialised diagnostics is empty. This commit changes Clang's serialised diagnostic reader, now it reports an appropriate error instead of crashing. rdar://31939877 Differential Revision: https://reviews.llvm.org/D35069 llvm-svn: 307384
Diffstat (limited to 'clang/test/Index')
-rw-r--r--clang/test/Index/Inputs/empty.dia0
-rw-r--r--clang/test/Index/read-empty-diags.test2
2 files changed, 2 insertions, 0 deletions
diff --git a/clang/test/Index/Inputs/empty.dia b/clang/test/Index/Inputs/empty.dia
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/clang/test/Index/Inputs/empty.dia
diff --git a/clang/test/Index/read-empty-diags.test b/clang/test/Index/read-empty-diags.test
new file mode 100644
index 00000000000..cef751c920a
--- /dev/null
+++ b/clang/test/Index/read-empty-diags.test
@@ -0,0 +1,2 @@
+// RUN: not c-index-test -read-diagnostics %S/Inputs/empty.dia 2>&1 | FileCheck %s
+// CHECK: Trouble deserializing file (Invalid File): Invalid diagnostics signature
OpenPOWER on IntegriCloud