]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/71085 (ICE with some intrinsic functions specifying array function...
authorHarald Anlauf <anlauf@gmx.de>
Sun, 4 Mar 2018 05:11:31 +0000 (05:11 +0000)
committerSteven G. Kargl <kargl@gcc.gnu.org>
Sun, 4 Mar 2018 05:11:31 +0000 (05:11 +0000)
2018-03-03  Harald Anlauf  <anlauf@gmx.de>

PR fortran/71085
* trans-expr.c (gfc_apply_interface_mapping_to_expr): Do not
dereference NULL pointer.

2018-03-03  Harald Anlauf  <anlauf@gmx.de>

PR fortran/71085
* gfortran.dg/pr71085.f90: New test.

From-SVN: r258230

gcc/fortran/ChangeLog
gcc/fortran/trans-expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr71085.f90 [new file with mode: 0644]

index 4196cf88c623de72c6255c0447e39072e9d90f24..c9505c43d4fc973d089b5315d5d1cf1bea8226ed 100644 (file)
@@ -1,3 +1,9 @@
+2018-03-03  Harald Anlauf  <anlauf@gmx.de>
+
+       PR fortran/71085
+       * trans-expr.c (gfc_apply_interface_mapping_to_expr): Do not
+       dereference NULL pointer.
+
 2018-03-03  Paul Thomas  <pault@gcc.gnu.org>
 
        Backport from trunk.
index f72503bd98355a1f5b052112d26dc195df4118b4..32b7b7c055ab0919e894c8197ed3877da85c26c7 100644 (file)
@@ -4287,6 +4287,8 @@ gfc_apply_interface_mapping_to_expr (gfc_interface_mapping * mapping,
 
       if (expr->value.function.esym == NULL
            && expr->value.function.isym != NULL
+           && expr->value.function.actual
+           && expr->value.function.actual->expr
            && expr->value.function.actual->expr->symtree
            && gfc_map_intrinsic_function (expr, mapping))
        break;
index f562bccf7442206ae13f2fff804f5a3d6621b138..1461d652a84216b88907348312c5d2aac597ef97 100644 (file)
@@ -1,3 +1,8 @@
+2018-03-03  Harald Anlauf  <anlauf@gmx.de>
+
+       PR fortran/71085
+       * gfortran.dg/pr71085.f90: New test.
+
 2018-03-03  Paul Thomas  <pault@gcc.gnu.org>
 
        Backport from trunk.
diff --git a/gcc/testsuite/gfortran.dg/pr71085.f90 b/gcc/testsuite/gfortran.dg/pr71085.f90
new file mode 100644 (file)
index 0000000..11d9850
--- /dev/null
@@ -0,0 +1,12 @@
+! { dg-do compile }
+! PR 71085
+!
+! Testcase from PR by Vladimir Fuka <vladimir.fuka@gmail.com>
+!
+program pr71085
+  print *, f()
+contains
+  function f()
+    integer :: f(iargc()*10)
+  end
+end