D_BUSY added, to check recursive deps in def modules

This commit is contained in:
ceriel
1986-12-16 15:22:33 +00:00
parent 33a89a8684
commit a92c8bf067
4 changed files with 10 additions and 5 deletions

View File

@@ -55,7 +55,7 @@ GetDefinitionModule(id, incr)
We may have to read the definition module itself.
Also increment level by "incr".
*/
struct def *df;
register struct def *df;
static int level;
struct scopelist *vis;
@@ -101,6 +101,10 @@ GetDefinitionModule(id, incr)
df->mod_vis = vis;
}
}
else if (df->df_flags & D_BUSY) {
error("definition module \"%s\" depends on itself",
id->id_text);
}
else if (df == Defined && level == 1) {
error("cannot import from currently defined module");
df->df_kind = D_ERROR;