llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

clang -fsanitize=alignment crashes with __builtin_assume_aligned

Open m-gupta opened this issue 3 years ago • 4 comments

// 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?

m-gupta avatar Aug 16 '22 00:08 m-gupta

This assertion fail seems to exist only when -fsanitize=alignment is enabled

https://godbolt.org/z/z8h3x7zd3

inclyc avatar Aug 16 '22 06:08 inclyc

@llvm/issue-subscribers-clang-frontend

llvmbot avatar Aug 16 '22 06:08 llvmbot

@llvm/issue-subscribers-clang-codegen

llvmbot avatar Aug 16 '22 06:08 llvmbot

Thanks for your fix @yronglin

int6 avatar Sep 03 '22 16:09 int6

Fixed by https://github.com/llvm/llvm-project/commit/6ed21fc515230ac2ea459d8aa90566e9a467bbb0

AaronBallman avatar Sep 07 '22 16:09 AaronBallman