PR c/70264: fix crash in compatible_locations_p with BUILTINS_LOCATION
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Mar 2016 18:27:47 +0000 (18:27 +0000)
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Mar 2016 18:27:47 +0000 (18:27 +0000)
commit7378dbfba6f452c66dc0ed7ad9fa83ef1cac64e1
tree50eca93808fd6cb6a328f1c827549ccd995c143d
parente2895b761a3b40a6aac45ab3401f4299a19c2af1
PR c/70264: fix crash in compatible_locations_p with BUILTINS_LOCATION

In r234088 my fix for PR c++/70105 didn't allow for the possibility that
when comparing a pair of macro expansion histories that one of the
macros in the history might not be located within a line-map, and
PR c/70264 reports a crash due to encountering BUILTINS_LOCATION within
the traversal.

Fixed thusly.

Successfully bootstrapped on x86_64-pc-linux-gnu; adds 4 PASS results
to gcc.sum and 12 to g++.sum.

gcc/ChangeLog:
PR c/70264
* diagnostic-show-locus.c (compatible_locations_p): Handle the case
where one or both locations aren't within a line_map.

gcc/testsuite/ChangeLog:
PR c/70264
* c-c++-common/pr70264.c: New test case.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234303 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/diagnostic-show-locus.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/pr70264.c [new file with mode: 0644]