diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2022-12-22 23:36:47 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-05-15 11:36:40 +0200 |
commit | f04dae641112509bfd4ec8bd76774ebedca28d1f (patch) | |
tree | d70658ca852e08542c5c881a169815fe1f5ae42a /gcc/rust/backend/rust-compile-base.h | |
parent | e90791e5a02b021d22ffb4c36673b9af623e2063 (diff) | |
download | gcc-f04dae641112509bfd4ec8bd76774ebedca28d1f.zip gcc-f04dae641112509bfd4ec8bd76774ebedca28d1f.tar.gz gcc-f04dae641112509bfd4ec8bd76774ebedca28d1f.tar.bz2 |
ada: Fix link to parent when copying with Copy_Separate_Tree
When flag More_Ids is set on a node, then syntactic children will have
their Parent link set to the last node in the chain of Mode_Ids.
For example, parameter associations in declaration like:
procedure P (X, Y : T);
will have More_Ids set for "X", Prev_Ids set on "Y" and both will have
the same node of "T" as their child. However, "T" will have only one
parent, i.e. "Y".
This anomaly was taken into account in New_Copy_Tree, but not in
Copy_Separate_Tree. This was leading to spurious errors in check for
ghost-correctness applied to copied specs.
gcc/ada/
* atree.ads
(Is_Syntactic_Node): Refactored from New_Copy_Tree.
* atree.adb
(Is_Syntactic_Node): Likewise.
(Copy_Separate_Tree): Use Is_Syntactic_Node.
* sem_util.adb
(Has_More_Ids): Move to Atree.
(Is_Syntactic_Node): Likewise.
Diffstat (limited to 'gcc/rust/backend/rust-compile-base.h')
0 files changed, 0 insertions, 0 deletions