]> granicus.if.org Git - clang/commit
[Frontend] Verify that the bitstream is not empty before reading
authorAlex Lorenz <arphaman@gmail.com>
Fri, 7 Jul 2017 10:25:12 +0000 (10:25 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Fri, 7 Jul 2017 10:25:12 +0000 (10:25 +0000)
commita43da8254fec1e97522a57b74b7a8f8bb04d827c
tree296471897d5c7b0da44e9ec8ac2ce016aa5512dc
parentebbbc9c7fc40acc88e1f6967b0d7d469b0f31a5e
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307384 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Frontend/SerializedDiagnosticReader.cpp
test/Index/Inputs/empty.dia [new file with mode: 0644]
test/Index/read-empty-diags.test [new file with mode: 0644]