Commit d136595d by Martin Liska Committed by Martin Liska

Fix another UBSAN in Fortran coarray.

2019-10-24  Martin Liska  <mliska@suse.cz>

	PR fortran/92174
	* array.c (gfc_resolve_array_spec): Break the loop
	for out of bounds index.
	* resolve.c (is_non_constant_shape_array): Likewise.

From-SVN: r277367
parent 0214d31a
2019-10-24 Martin Liska <mliska@suse.cz>
PR fortran/92174
* array.c (gfc_resolve_array_spec): Break the loop
for out of bounds index.
* resolve.c (is_non_constant_shape_array): Likewise.
2019-10-23 Steven G. Kargl <kargl@gcc.gnu.org>
dump-parse-tree.c (show_expr): Add dumping of BT_BOZ constants.
......
......@@ -410,6 +410,9 @@ gfc_resolve_array_spec (gfc_array_spec *as, int check_constant)
for (i = 0; i < as->rank + as->corank; i++)
{
if (i == GFC_MAX_DIMENSIONS)
return false;
e = as->lower[i];
if (!resolve_array_bound (e, check_constant))
return false;
......
......@@ -12266,6 +12266,9 @@ is_non_constant_shape_array (gfc_symbol *sym)
simplification now. */
for (i = 0; i < sym->as->rank + sym->as->corank; i++)
{
if (i == GFC_MAX_DIMENSIONS)
break;
e = sym->as->lower[i];
if (e && (!resolve_index_expr(e)
|| !gfc_is_constant_expr (e)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment