bug-gnucobol
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[open-cobol-list] Minor bug (with patch) - INITIALIZE <fld> with FILLER


From: Roger While
Subject: [open-cobol-list] Minor bug (with patch) - INITIALIZE <fld> with FILLER
Date: Tue, 16 Jun 2009 08:36:01 +0200

> There is a minor bug in open-cobol-1.1 (2009-02-06).
>
> When doing INITIALIZE <fld> with FILLER, and <fld> is either 01 in the
> file section or a redefinition, no code is emitted.

Instead of doing a tristate on the variable, lets do
this sanely.
In the cb_initialize structure,
rename flag_statement to init_statement and introduce a new
field no_filler_init.
Add extra parameter to cb_build_initialize.
In typeck.c, then it becomes -
        no_fill_init = (fillinit == NULL);
        for (l = vars; l; l = CB_CHAIN (l)) {
                cb_emit (cb_build_initialize (CB_VALUE (l), value, replacing,
                                              def, 1, no_fill_init));
        }

Other places which call cb_build_initialize use 0, 0 as last
parameters.
In codegen.c, the tests become -
        if (f->redefines && (!topfield || !p->init_statement)) {
                return INITIALIZE_NONE;
        }

and

        if (f->flag_filler && p->no_filler_init && !f->children) {
                return INITIALIZE_NONE;
        }

(Yes, that flag_filler is new).

Will be in next tarball along with OC test for this.

Roger



reply via email to

[Prev in Thread] Current Thread [Next in Thread]