~sircmpwn/annotatec

b4aeb2abc7b25ebaf33397d53f666e26675ea759 — Drew DeVault 7 months ago eb1eb33
Fix removal of symbol from doubly linked list
1 files changed, 7 insertions(+), 1 deletions(-)

M graph.c
M graph.c => graph.c +7 -1
@@ 30,7 30,7 @@ static struct symbol_definition *get_or_cache_symbol(
		symbol = bucket->symbol;
		if (bucket->hash == hash && strcmp(symbol->name, name) == 0) {
			if (((symbol->is_static || is_static) && file == symbol->file) ||
					(symbol->file && file)) {
					(!(symbol->is_static || is_static) && symbol->file && file)) {
				/* Duplicate symbols */
				fprintf(stderr, "\nWarning: duplicate symbol %s "
						"(in both %s and %s; using former as canonical)", name,


@@ 45,10 45,16 @@ static struct symbol_definition *get_or_cache_symbol(
				symbol->lineno = lineno;
				symbol->colno = colno;
				symbol->is_static = is_static;
				if (symbol->next) {
					symbol->next->prev = symbol->prev;
				}
				if (symbol->prev) {
					symbol->prev->next = symbol->next;
				}
				++file->nsyms;
				if (file->symbols) {
					file->symbols->prev = symbol;
				}
				symbol->next = file->symbols;
				file->symbols = symbol;
				return symbol;