PR preprocessor/59935 - caret diagnostics crashes on non-file locations
commit9e8234d09987776a1ffda8956d76c49cb6052587
authordodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 28 Jan 2014 15:03:19 +0000 (28 15:03 +0000)
committerdodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 28 Jan 2014 15:03:19 +0000 (28 15:03 +0000)
treefbc9e0ef5ef690d21749ed8b474f18cbf615fb05
parentc223850c2ddf5e7a8695dc3a436a87ef3b714d42
PR preprocessor/59935 - caret diagnostics crashes on non-file locations

gcc/ChangeLog

* input.c (location_get_source_line): Bail out on when line number
is zero, and test the return value of
lookup_or_add_file_to_cache_tab.

gcc/testsuite/ChangeLog

* c-c++-common/cpp/warning-zero-location.c: New test.
* c-c++-common/cpp/warning-zero-location-2.c: Likewise.

Signed-off-by: Dodji Seketeli <dodji@seketeli.org>
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207195 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/input.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/cpp/warning-zero-location-2.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/cpp/warning-zero-location.c [new file with mode: 0644]