diff options
author | Harald Anlauf <anlauf@gmx.de> | 2020-06-04 21:00:33 +0200 |
---|---|---|
committer | Giuliano Belinassi <giuliano.belinassi@usp.br> | 2020-08-17 13:10:24 -0300 |
commit | 4e62c505a2146e7688c72619f44b79eabda8b9c2 (patch) | |
tree | 7b1497b8fbf2a3959769152534963cdb24436978 /gcc/fortran/trans-expr.c | |
parent | 8defb2548b5f3987c2b1a1a3675cdb887e47cd64 (diff) | |
download | gcc-4e62c505a2146e7688c72619f44b79eabda8b9c2.zip gcc-4e62c505a2146e7688c72619f44b79eabda8b9c2.tar.gz gcc-4e62c505a2146e7688c72619f44b79eabda8b9c2.tar.bz2 |
PR fortran/95500 - Segfault compiling extra interface on intrinsic
Converting an expression so that it can be passed by reference could
result in a NULL pointer dereference.
2020-06-04 Steven G. Kargl <kargl@gcc.gnu.org>
Harald Anlauf <anlauf@gmx.de>
gcc/fortran/
PR fortran/95500
* trans-expr.c (gfc_conv_expr_reference): Do not dereference NULL
pointer.
gcc/testsuite/
PR fortran/95500
* gfortran.dg/pr95500.f90: New test.
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r-- | gcc/fortran/trans-expr.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 435eaeb..8b2afd2 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -8811,6 +8811,7 @@ gfc_conv_expr_reference (gfc_se * se, gfc_expr * expr, bool add_clobber) if (expr->expr_type == EXPR_FUNCTION && ((expr->value.function.esym + && expr->value.function.esym->result && expr->value.function.esym->result->attr.pointer && !expr->value.function.esym->result->attr.dimension) || (!expr->value.function.esym && !expr->ref |