From 3e5989463fa9804e8ef31d3921d426fa9fa06122 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 14 Feb 2011 10:35:54 +0900 Subject: [PATCH] Update the def_tail when removing the last def from the space. --- tools/qfcc/source/def.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/qfcc/source/def.c b/tools/qfcc/source/def.c index 0ddd8458f..b62e1255c 100644 --- a/tools/qfcc/source/def.c +++ b/tools/qfcc/source/def.c @@ -154,7 +154,11 @@ free_def (def_t *def) for (d = &def->space->defs; *d && *d != def; d = &(*d)->next) ; + if (!*d) + internal_error (0, "freeing unlinked def %s", def->name); *d = def->next; + if (&def->next == def->space->def_tail) + def->space->def_tail = d; if (!def->external) defspace_free_loc (def->space, def->offset, type_size (def->type)); }