From 1abf66e7feb3b53374a1741b013a4fb8f189cd2a Mon Sep 17 00:00:00 2001 From: "James K. Lowden" <jklowden@symas.com> Date: Thu, 6 Jul 2023 13:42:24 -0400 Subject: [PATCH] fixed #15 --- gcc/cobol/parse.y | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/cobol/parse.y b/gcc/cobol/parse.y index 18f54c1402be..3b0dc8e20829 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. -- GitLab