diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2017-10-28 08:49:26 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2017-10-28 08:49:26 +0000 |
commit | 575b527e5798ecbf5d36974bae2c87974019fefd (patch) | |
tree | b5ce579d741daf86e8ee8acd2b8a0ddeae5cf9b3 /gcc/fortran | |
parent | 7324369a12e9abe3011f6a0cfd8ef48dd44c4729 (diff) | |
download | gcc-575b527e5798ecbf5d36974bae2c87974019fefd.zip gcc-575b527e5798ecbf5d36974bae2c87974019fefd.tar.gz gcc-575b527e5798ecbf5d36974bae2c87974019fefd.tar.bz2 |
re PR fortran/81758 ([OOP] Broken vtab)
2017-10-28 Paul Thomas <pault@gcc.gnu.org>
PR fortran/81758
* trans-expr.c (trans_class_vptr_len_assignment): 'vptr_expr'
must only be set if the right hand side expression is of type
class.
2017-10-28 Paul Thomas <pault@gcc.gnu.org>
PR fortran/81758
* gfortran.dg/class_63.f90: New test.
From-SVN: r254195
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/trans-expr.c | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index a871fc2..7ad2427 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2017-10-28 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/81758 + * trans-expr.c (trans_class_vptr_len_assignment): 'vptr_expr' + must only be set if the right hand side expression is of type + class. + 2017-10-27 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/82620 diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 4e8bfc5..71ec176 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -8053,7 +8053,7 @@ trans_class_vptr_len_assignment (stmtblock_t *block, gfc_expr * le, { /* Get the vptr from the rhs expression only, when it is variable. Functions are expected to be assigned to a temporary beforehand. */ - vptr_expr = re->expr_type == EXPR_VARIABLE + vptr_expr = (re->expr_type == EXPR_VARIABLE && re->ts.type == BT_CLASS) ? gfc_find_and_cut_at_last_class_ref (re) : NULL; if (vptr_expr != NULL && vptr_expr->ts.type == BT_CLASS) |