Skip to content

[clang][static analyzer] Crash when program contains __builtin_bit_cast #94496

@ormris

Description

@ormris

The static analyzer crashes when passed a small program containing __builtin_bit_cast.

$ cat test.cpp
int *a;
char b[4];
void c() { a[__builtin_bit_cast(int, b)]; }
$ clang++ --version |& grep version
clang version 19.0.0git (git@github.com:llvm/llvm-project.git dd82fd4744397e0510c8204f1a6031441e21858e)
$ clang++ --analyze test.cpp
clang++: <HOME>/llvm-project/llvm/include/llvm/Support/Casting.h:566: decltype(auto) llvm::cast(const From &) [To = clang::ento::NonLoc, From = clang::ento::SVal]: Assertion `isa<To>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
...
$

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions