core: Fix cu__for_each_variable to cover an empty tags table

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2009-03-31 17:50:19 -03:00
parent d7d419f6ab
commit 0bc59195d4
1 changed files with 2 additions and 4 deletions

View File

@ -217,10 +217,8 @@ static inline void cu__cache_symtab(struct cu *self)
* @id: uint32_t tag id
*/
#define cu__for_each_variable(cu, id, pos) \
for (id = 0, pos = cu->tags_table.entries[id]; \
id < cu->tags_table.nr_entries; \
pos = cu->tags_table.entries[++id]) \
if (pos == NULL || \
for (id = 0; id < cu->tags_table.nr_entries; ++id) \
if (!(pos = cu->tags_table.entries[id]) || \
!tag__is_variable(pos)) \
continue; \
else