]> git.ipfire.org Git - thirdparty/gcc.git/commit
a68: add explicative comment to are_packs_equivalent
authorJose E. Marchesi <jemarch@gnu.org>
Sat, 17 Jan 2026 20:56:20 +0000 (21:56 +0100)
committerJose E. Marchesi <jemarch@gnu.org>
Sat, 17 Jan 2026 20:56:20 +0000 (21:56 +0100)
commitf89e3c8acdc3a0e12aa8eaaec1bc9c67ea6fde98
tree7c37c9a15670d092f11d70a9962242902b4c65e3
parentde1f9a97688112beea79b3a33f3d7860ccd0f3a3
a68: add explicative comment to are_packs_equivalent

While fixing PR algol68/123653 I noticed that there was a struct mode
interned in the compiler with the form `struct (ref int)'.  This is
odd because fields are supposed to have names in struct modes.

Turns out that the culprit is:

    (void) a68_add_mode_to_pack (&z, M_REF_INT, NO_TEXT, NO_NODE);

    EQUIVALENT (M_SEMA) = a68_add_mode (&TOP_MOID (&A68_JOB),
                                        STRUCT_SYMBOL,
                                        a68_count_pack_members (z),
                                        NO_NODE, NO_MOID, z);

i.e. it is the standard mode `sema'.  The report says that it is a
struct that hold a reference to int within, but you are not allowed to
access it.

This patch adds a comment to are_packs_equivalent explaining why the
name of a pack may be NULL.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
gcc/algol68/ChangeLog

* a68-parser-moids-equivalence.cc (are_packs_equivalent): Add
explicative comment.
gcc/algol68/a68-parser-moids-equivalence.cc