llvm-project
llvm-project copied to clipboard
clang -fsanitize=alignment crashes with __builtin_assume_aligned
// clang -c -fsanitize=alignment test.c
int main ()
{
(void) __builtin_assume_aligned("", 1);
return 0;
}
llvm/llvm-project/clang/include/clang/AST/Type.h:691: const ExtQualsTypeCommonBase *clang::QualType::getCommonPtr() const: Assertion `!isNull() && "Cannot retrieve a NULL type pointer"' failed.
@vitalybuka can you please check?
This assertion fail seems to exist only when -fsanitize=alignment is enabled
https://godbolt.org/z/z8h3x7zd3
@llvm/issue-subscribers-clang-frontend
@llvm/issue-subscribers-clang-codegen
Thanks for your fix @yronglin
Fixed by https://github.com/llvm/llvm-project/commit/6ed21fc515230ac2ea459d8aa90566e9a467bbb0