diff options
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/optimize.c | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6920109..391aa5f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2018-03-03 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/71464 + * optimize.c (maybe_thunk_body): Bail out immediately if either + fns[0] or fns[1] is null. + 2018-03-02 Marek Polacek <polacek@redhat.com> PR c++/84578 diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c index a1cb610..fdb1650 100644 --- a/gcc/cp/optimize.c +++ b/gcc/cp/optimize.c @@ -261,8 +261,12 @@ maybe_thunk_body (tree fn, bool force) populate_clone_array (fn, fns); + /* Can happen during error recovery (c++/71464). */ + if (!fns[0] || !fns[1]) + return 0; + /* Don't use thunks if the base clone omits inherited parameters. */ - if (fns[0] && ctor_omit_inherited_parms (fns[0])) + if (ctor_omit_inherited_parms (fns[0])) return 0; DECL_ABSTRACT_P (fn) = false; |