did not handle HOL names right (null names)

This commit is contained in:
ceriel 1987-07-29 10:43:43 +00:00
parent 3cd5074594
commit 3b0057625d
2 changed files with 7 additions and 4 deletions

View file

@ -172,11 +172,13 @@ STATIC bool name_exists(name,endp,endd)
proc_p p; proc_p p;
dblock_p d; dblock_p d;
if (! name) return FALSE; /* HOL blocks don't have names */
for (p = fproc; p != endp; p = p->p_next) { for (p = fproc; p != endp; p = p->p_next) {
if (strcmp(name,pnames[p->p_id]) == 0) return TRUE; if (strcmp(name,pnames[p->p_id]) == 0) return TRUE;
} }
for (d = fdblock; d != endd; d = d->d_next) { 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; return FALSE;
} }

View file

@ -88,7 +88,7 @@ STATIC outsym(s,t)
STATIC outdsym(dbl) STATIC outdsym(dbl)
dblock_p 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; dbl = obj->o_dblock;
if ((dbl->d_flags2 & DF_SYMOUT) == 0) { if ((dbl->d_flags2 & DF_SYMOUT) == 0) {
dbl->d_flags2 |= DF_SYMOUT; 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); outinst(ps_ina);
outdsym(dbl); outdsym(dbl);
} }
@ -154,7 +155,7 @@ STATIC coutobject(obj)
* hol block; the offset is omitted if it is 0 and the label * hol block; the offset is omitted if it is 0 and the label
* was not omitted. * was not omitted.
*/ */
if (dnames[obj->o_dblock->d_id][0] == '\0') { if (dnames[obj->o_dblock->d_id] == 0) {
coutoff(obj->o_off); coutoff(obj->o_off);
} else { } else {
if (obj->o_off == 0) { if (obj->o_off == 0) {