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

Enhance robustness of '[ ]' operator for array access. #83

Closed
HPCguy opened this issue Oct 28, 2021 · 2 comments
Closed

Enhance robustness of '[ ]' operator for array access. #83

HPCguy opened this issue Oct 28, 2021 · 2 comments

Comments

@HPCguy
Copy link
Contributor

HPCguy commented Oct 28, 2021

Creating an issue for this so it can be tracked.

Using an array operator '[ ]' is currently supported for use with (certain) pointer variables in array expressions, but not always. The goal of this ticket is to be able to use the array operator '[ ]' in expressions, working as expected under every possible circumstance. Note that having '[ ]' work for declarations also needs to be improved, and is submitted as a separate issue.

@HPCguy
Copy link
Contributor Author

HPCguy commented Feb 7, 2022

I am opening a branch to work on this.

For example, compiling the following:

int main()
{
struct point {
int x, y;
} *p;
int i;

p = (struct point *) malloc(10*sizeof(struct point));

for (i = 0; i < 10; ++i) {
p[i].x = 0;
}

return 0;
}

results in the error:

$ ./amacc -o arr arr.c
16: compiler error gen=-1228300496

@HPCguy
Copy link
Contributor Author

HPCguy commented Feb 11, 2022

Closed by #88

@HPCguy HPCguy closed this as completed Feb 11, 2022
jserv pushed a commit that referenced this issue Feb 12, 2022
Using an array operator '[ ]' is currently supported for use with (certain) pointer
variables in array expressions, but not always. The goal of this patch is to be able
to use the array operator '[ ]' in expressions, working as expected under every
possible circumstance. Note that having '[ ]' work for declarations also needs to
be improved.

Close #83 

Co-authored-by: HPCguy <Anonymous>
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