-
Notifications
You must be signed in to change notification settings - Fork 13.6k
clang: 18: Assertion `getType(Base)->isPointerType() || getType(Base)->isArrayType()' failed. #69468
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
Comments
@llvm/issue-subscribers-clang-frontend Author: wt.cc (wierton)
Compiler Explorer: https://gcc.godbolt.org/z/9Yz4fTevr
When compile this program with clang (version 5a56f00), clang crashes:
Stack dump:
|
69cf59e is the first bad commit |
In the first line,
|
This is not particular to C: https://gcc.godbolt.org/z/v6TbP3WGs |
If we look before it asserts in the call to llvm-project/clang/lib/AST/APValue.cpp Lines 73 to 80 in f2afd10
That expr D->isInvalidDecl()
(bool) $1 = true the first iteration through the loop IncompleteArrayType 0x14a8e28e0 'char[]'
`-BuiltinType 0x14a831eb0 'char' The next iteration gets us back to expr Redecl->isInvalidDecl())
(bool) $2 = true I think the logic needs to be adjusted slightly so that I verified this fixes the problem and does not break |
Yeah, bailing out if we see any invalid declaration seems reasonable to me. |
…nvalid decl In some cases when calling APValue::LValueBase::getType() when we have a ValueDecl in some cases we don't handle invalid decls. We iterating over redeclarations we reset the current decl to the current most recent decl and we check the next redeclaration to ensure it is not invalid. Fixes: llvm#69468
Compiler Explorer: https://gcc.godbolt.org/z/9Yz4fTevr
When compile this program with clang (version 5a56f00), clang crashes:
Stack dump:
The text was updated successfully, but these errors were encountered: