Skip to content

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

@co-neco

Description

@co-neco

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);

...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions