PR c/70264: fix crash in compatible_locations_p with BUILTINS_LOCATION
authorDavid Malcolm <dmalcolm@redhat.com>
Thu, 17 Mar 2016 18:27:47 +0000 (18:27 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Thu, 17 Mar 2016 18:27:47 +0000 (18:27 +0000)
commitded6091379ad0d03bf5ea26633d501b026615c09
tree50eca93808fd6cb6a328f1c827549ccd995c143d
parent17366700d4ddcefeb271677029f59646a37a8ed3
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.

From-SVN: r234303
gcc/ChangeLog
gcc/diagnostic-show-locus.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/pr70264.c [new file with mode: 0644]