diff options
author | Martin Liska <mliska@suse.cz> | 2019-08-15 08:58:26 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2019-08-15 06:58:26 +0000 |
commit | b275fd98f267ea870c9583e8a28f1348777786a3 (patch) | |
tree | f24da3e39bacc9e4e98aa2ce5d43e44b36b8a98c /gcc/cgraph.c | |
parent | 0c04043ec41297ad3aa4f92c38b61b7cf2aa40ae (diff) | |
download | gcc-b275fd98f267ea870c9583e8a28f1348777786a3.zip gcc-b275fd98f267ea870c9583e8a28f1348777786a3.tar.gz gcc-b275fd98f267ea870c9583e8a28f1348777786a3.tar.bz2 |
Add ::verify for cgraph_node::origin/nested/next_nested.
2019-08-15 Martin Liska <mliska@suse.cz>
* cgraph.c (cgraph_node::verify_node): Verify origin, nested
and next_nested.
From-SVN: r274503
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r-- | gcc/cgraph.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c index ed46d81..eb38b90 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -3464,6 +3464,30 @@ cgraph_node::verify_node (void) e->aux = 0; } } + + if (nested != NULL) + { + for (cgraph_node *n = nested; n != NULL; n = n->next_nested) + { + if (n->origin == NULL) + { + error ("missing origin for a node in a nested list"); + error_found = true; + } + else if (n->origin != this) + { + error ("origin points to a different parent"); + error_found = true; + break; + } + } + } + if (next_nested != NULL && origin == NULL) + { + error ("missing origin for a node in a nested list"); + error_found = true; + } + if (error_found) { dump (stderr); |