From 3b0057625d522cbd05de053a2868aca5137e4f90 Mon Sep 17 00:00:00 2001 From: ceriel Date: Wed, 29 Jul 1987 10:43:43 +0000 Subject: [PATCH] did not handle HOL names right (null names) --- util/ego/ca/ca.c | 4 +++- util/ego/ca/ca_put.c | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/util/ego/ca/ca.c b/util/ego/ca/ca.c index f0b350957..e3f49e632 100644 --- a/util/ego/ca/ca.c +++ b/util/ego/ca/ca.c @@ -172,11 +172,13 @@ STATIC bool name_exists(name,endp,endd) proc_p p; dblock_p d; + if (! name) return FALSE; /* HOL blocks don't have names */ for (p = fproc; p != endp; p = p->p_next) { if (strcmp(name,pnames[p->p_id]) == 0) return TRUE; } for (d = fdblock; d != endd; d = d->d_next) { - if (strcmp(name,dnames[d->d_id]) == 0) return TRUE; + if (dnames[d->d_id] != 0 && /* HOL blocks excluded */ + strcmp(name,dnames[d->d_id]) == 0) return TRUE; } return FALSE; } diff --git a/util/ego/ca/ca_put.c b/util/ego/ca/ca_put.c index bee4f8e4a..ceee74f4e 100644 --- a/util/ego/ca/ca_put.c +++ b/util/ego/ca/ca_put.c @@ -88,7 +88,7 @@ STATIC outsym(s,t) STATIC outdsym(dbl) dblock_p dbl; { - outsym(dnames[dbl->d_id],sp_dnam); + if (dnames[dbl->d_id]) outsym(dnames[dbl->d_id],sp_dnam); } @@ -126,7 +126,8 @@ STATIC outdocc(obj) obj_p obj; { dbl = obj->o_dblock; if ((dbl->d_flags2 & DF_SYMOUT) == 0) { dbl->d_flags2 |= DF_SYMOUT; - if ((dbl->d_flags1 & DF_EXTERNAL) == 0) { + if (dnames[dbl->d_id] != 0 && + (dbl->d_flags1 & DF_EXTERNAL) == 0) { outinst(ps_ina); outdsym(dbl); } @@ -154,7 +155,7 @@ STATIC coutobject(obj) * hol block; the offset is omitted if it is 0 and the label * was not omitted. */ - if (dnames[obj->o_dblock->d_id][0] == '\0') { + if (dnames[obj->o_dblock->d_id] == 0) { coutoff(obj->o_off); } else { if (obj->o_off == 0) {