diff options
author | Chris Hall (GMCH) <chris.hall@highwayman.com> | 2009-12-10 11:41:54 +0000 |
---|---|---|
committer | Chris Hall (GMCH) <chris.hall@highwayman.com> | 2009-12-10 11:41:54 +0000 |
commit | 3cad62944e8270fcd9562f6d115c064d61211c6c (patch) | |
tree | 1d63dd0e405577cfa2161b215c7da4e9d5b292d0 /lib/symtab.c | |
parent | 120e91359392aa18f257cd88e77d762c32eb8a4f (diff) | |
download | quagga-3cad62944e8270fcd9562f6d115c064d61211c6c.tar.bz2 quagga-3cad62944e8270fcd9562f6d115c064d61211c6c.tar.xz |
Allow orphan symbols to be unset -- lib/symtab.c
May not set orphan symbol values to anything meaningful, but must be
allowed to unset an orphan value (which is already unset) so that
when reaming a symbol table ordinary value delete/unset functions can
be called.
So fixed the assert which was disallowing all value changes for
orphans, in symbol_set_value().
Diffstat (limited to 'lib/symtab.c')
-rw-r--r-- | lib/symtab.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/symtab.c b/lib/symtab.c index 9a833a14..adc21e73 100644 --- a/lib/symtab.c +++ b/lib/symtab.c @@ -86,7 +86,7 @@ * If there are no references to the symbol, the symbol entry is released. * If there are references to the symbol, it is preserved (as an orphan) until * all references are unset. The value of an orphaned symbol should not be - * changed. + * changed (but may be unset, since it is already unset). * * There are two, parallel mechanisms for keeping track of references to a * symbol: @@ -880,7 +880,8 @@ symbol_set_value(symbol sym, void* new_value) { void* old_value ; - assert(sym->table != NULL) ; /* may not set value for orphan symbol ! */ + assert((sym->table != NULL) || (new_value == NULL)) ; + /* may not set non-NULL value for orphan symbol ! */ old_value = sym->value ; sym->value = new_value ; |