diff options
author | Jan Hubicka <jh@suse.cz> | 2020-08-01 17:57:08 +0200 |
---|---|---|
committer | Jan Hubicka <jh@suse.cz> | 2020-08-01 17:57:08 +0200 |
commit | 75a23e59031fe673fc3b2e60fd1fe5f4c70ecb85 (patch) | |
tree | f4d7e2bb9079c7bb86905f507cf5cf324d9064c3 /gcc/symtab.c | |
parent | 13cdbb6a97c3d853cd380e5a03be8e0d35966c1e (diff) | |
download | gcc-75a23e59031fe673fc3b2e60fd1fe5f4c70ecb85.zip gcc-75a23e59031fe673fc3b2e60fd1fe5f4c70ecb85.tar.gz gcc-75a23e59031fe673fc3b2e60fd1fe5f4c70ecb85.tar.bz2 |
Verify symtab order
* symtab.c (symtab_node::verify_base): Verify order.
(symtab_node::verify_symtab_nodes): Verify order.
Diffstat (limited to 'gcc/symtab.c')
-rw-r--r-- | gcc/symtab.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/symtab.c b/gcc/symtab.c index 0e852d4..d7dfbb6 100644 --- a/gcc/symtab.c +++ b/gcc/symtab.c @@ -1085,6 +1085,11 @@ symtab_node::verify_base (void) error ("node has unknown type"); error_found = true; } + if (order < 0 || order >= symtab->order) + { + error ("node has invalid order %i", order); + error_found = true; + } if (symtab->state != LTO_STREAMING) { @@ -1326,6 +1331,14 @@ symtab_node::verify_symtab_nodes (void) { symtab_node *node; hash_map<tree, symtab_node *> comdat_head_map (251); + asm_node *anode; + + for (anode = symtab->first_asm_symbol (); anode; anode = anode->next) + if (anode->order < 0 || anode->order >= symtab->order) + { + error ("invalid order in asm node %i", anode->order); + internal_error ("symtab_node::verify failed"); + } FOR_EACH_SYMBOL (node) { |