diff options
-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) { |