+2008-02-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/35059
+ * expr.c (find_array_element): Modify traversing the constructor to
+ avoid trying to access NULL memory pointed to by next for the
+ last element. (find_array_section): Exit while loop if cons->next is
+ NULL.
+ * trans-expr.c (gfc_conv_scalar_char_value): Initialize gfc_typespec.
+ (gfc_conv_function_call): Same.
+ * decl.c (gfc_match_implicit): Same.
+ * trans-intrinsic.c (gfc_conv_intrinsic_sr_kind): Same.
+
2008-02-28 Daniel Franke <franke.daniel@gmail.com>
PR fortran/31463
int c;
match m;
+ gfc_clear_ts (&ts);
+
/* We don't allow empty implicit statements. */
if (gfc_match_eos () == MATCH_YES)
{
mpz_mul (span, span, tmp);
}
- if (cons)
- {
- for (nelemen = mpz_get_ui (offset); nelemen > 0; nelemen--)
- {
- if (cons->iterator)
- {
- cons = NULL;
- goto depart;
- }
- cons = cons->next;
- }
- }
+ for (nelemen = mpz_get_ui (offset); nelemen > 0; nelemen--)
+ {
+ if (cons)
+ {
+ if (cons->iterator)
+ {
+ cons = NULL;
+
+ goto depart;
+ }
+ cons = cons->next;
+ }
+ }
depart:
mpz_clear (delta);
cons = base;
}
- while (mpz_cmp (ptr, index) > 0)
+ while (cons && cons->next && mpz_cmp (ptr, index) > 0)
{
mpz_add_ui (index, index, one);
cons = cons->next;
if ((*expr)->expr_type == EXPR_CONSTANT)
{
gfc_typespec ts;
+ gfc_clear_ts (&ts);
*expr = gfc_int_expr ((int)(*expr)->value.character.string[0]);
if ((*expr)->ts.kind != gfc_c_int_kind)
stringargs = NULL_TREE;
var = NULL_TREE;
len = NULL_TREE;
+ gfc_clear_ts (&ts);
if (sym->from_intmod == INTMOD_ISO_C_BINDING)
{
else
{
gfc_typespec ts;
+ gfc_clear_ts (&ts);
+
if (actual->expr->ts.kind != gfc_c_int_kind)
{
/* The arguments to SELECTED_REAL_KIND are INTEGER(4). */