mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
Catch symtab operations with an invalid symtab.
Just via a simple segfault, but it's better than silently missing incorrect usage.
This commit is contained in:
parent
49cc4fed0c
commit
9cb0ca6fed
1 changed files with 4 additions and 4 deletions
|
@ -94,11 +94,11 @@ symbol_t *
|
|||
symtab_lookup (symtab_t *symtab, const char *name)
|
||||
{
|
||||
symbol_t *symbol;
|
||||
while (symtab) {
|
||||
do {
|
||||
if ((symbol = Hash_Find (symtab->tab, name)))
|
||||
return symbol;
|
||||
symtab = symtab->parent;
|
||||
}
|
||||
} while (symtab);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -160,7 +160,7 @@ symtab_flat_copy (symtab_t *symtab, symtab_t *parent)
|
|||
symbol_t *symbol;
|
||||
|
||||
newtab = new_symtab (parent, stab_local);
|
||||
while (symtab) {
|
||||
do {
|
||||
for (symbol = symtab->symbols; symbol; symbol = symbol->next) {
|
||||
if (Hash_Find (newtab->tab, symbol->name))
|
||||
continue;
|
||||
|
@ -171,7 +171,7 @@ symtab_flat_copy (symtab_t *symtab, symtab_t *parent)
|
|||
// Set the tail pointer so symbols in ancestor tables come before
|
||||
// those in decendent tables.
|
||||
newtab->symtail = &newtab->symbols;
|
||||
}
|
||||
} while (symtab);
|
||||
// Reset the tail pointer so any symbols added to newtab come after
|
||||
// those copied from the input symbol table chain.
|
||||
for (symbol = newtab->symbols; symbol && symbol->next;
|
||||
|
|
Loading…
Reference in a new issue