#57·acwj

In section 19(Array), we should check the use of array name.

Author: co-necoCreated Jan 7, 2023Updated Jan 7, 2023

In expr.c file:

static struct ASTnode *primary(void) { ... id = findglob(Text); if (id == -1) fatals("Unknown variable", Text);

if (Gsym[id].stype == S_ARRAY)
    n = mkastleaf(A_ADDR, Gsym[id].type, id);
else if (Gsym[id].stype != S_VARIABLE)
    fatals("Wrong stype of identifier", Text);

... }