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

Fix assert in bounds widening "BinaryNode operator must equal parent operator" #928

Closed
secure-sw-dev-bot opened this issue Jan 16, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@secure-sw-dev-bot
Copy link

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


Handle the following case in bounds widening:

void f(int i) {
  _Nt_array_ptr<char> p : count(0) = "a";

  if (*(p + (0 * 1)))
  {}
}

Currently, we hit an assert:

clang-9: /usr/local/magrang/master/src/clang/lib/AST/PreorderAST.cpp:46: void clang::PreorderAST::RemoveNode(clang::Node*, clang::Node*): Assertion `B->Opc == P->Opc && "BinaryNode operator must equal parent operator"' failed.

This is because we have incorrectly added the requirement that in order to remove a BinaryNode its opcode should be equal to its parent opcode which is not valid in this case.

@secure-sw-dev-bot secure-sw-dev-bot added the bug Something isn't working label Jan 16, 2022
@secure-sw-dev-bot
Copy link
Author

Comment from @mgrang:

Fixed in checkedc/checkedc-clang#943

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