Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
co-neco opened this issue Jan 7, 2023 · 0 comments
Open

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

co-neco opened this issue Jan 7, 2023 · 0 comments

Comments

@co-neco
Copy link

co-neco commented 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);

...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant