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

Where clause parsing does not gracefully exit in case of an invalid decl #1096

Open
secure-sw-dev-bot opened this issue Jan 17, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@secure-sw-dev-bot
Copy link

This issue was copied from checkedc/checkedc-clang#1096


If we have code like this:

void f() {
  _Nt_array_ptr<char> p : count(0);
}

The compiler emits an error:

a.c:4: error: automatic variable 'p' with bounds must have initializer
  _Nt_array_ptr<char> p : count(0);

However, if a where clause is attached to this invalid decl:

void f() {
  _Nt_array_ptr<char> p : count(0) _Where 1 == 1;
}

The compiler runs into an infinite loop and emits a lot of these error messages:

a.c:4:44: error: where clause on invalid decl
a.c:4:44: error: where clause on invalid decl
a.c:4:44: error: where clause on invalid decl
a.c:4:44: error: where clause on invalid decl
a.c:4:44: error: where clause on invalid decl
a.c:4:44: error: where clause on invalid decl
a.c:4:44: error: where clause on invalid decl
a.c:4:44: error: where clause on invalid decl
a.c:4:44: error: where clause on invalid decl
a.c:4:44: error: where clause on invalid decl
a.c:4:44: error: where clause on invalid decl
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant