diff --git a/gcc/cobol/parse.y b/gcc/cobol/parse.y index 18f54c1402be8d1faea7f8221688c708521596c0..3b0dc8e208296916fa81321ab2cadc9690f85e36 100644 --- a/gcc/cobol/parse.y +++ b/gcc/cobol/parse.y @@ -9318,6 +9318,7 @@ initialize_statement( cbl_refer_t tgt, bool with_filler, auto e = symbol_at(imember); if( e->type != SymField ) continue; auto f = cbl_field_of(e); + if( symbol_redefines(f) ) return false; if( ! (f->type == FldGroup || is_elementary(f->type)) ) continue; tgt.field = f; @@ -9331,8 +9332,10 @@ initialize_statement( cbl_refer_t tgt, bool with_filler, return fOK; } + if( !is_elementary(tgt.field->type) ) return false; + assert(is_elementary(tgt.field->type)); - assert( data_category_of(tgt) != data_category_none ); + assert(data_category_of(tgt) != data_category_none); /* * Initialize elementary field.