<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62130>62130</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Clang Static Analyzer] Crash/Assertion violation on Windows for LLVM 16
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hahn-absint
</td>
</tr>
</table>
<pre>
I am experiencing crashes (segmentation faults when built as release mode) aka assertion failure (when built as release + assertions) when using the clang static analyzer on Windows.
I tried LLVM 16, and also the newest version of branch release/16.x; both fail:
```
clang version 16.0.2
Target: x86_64-pc-windows-msvc
Thread model: posix
```
```
Assertion failed: isa<To>(Val) && "cast<Ty>() argument of incompatible type!", file llvm\include\llvm/Support/Casting.h, line 567
Stack dump:
0. Program arguments: clang -c --analyze C:\\Users\\user\\broken.c
1. <eof> parser at end of file
Exception Code: 0x80000003
```
The stack trace is rather useless (just hex addresses) as it was not a debug build.
Code:
```
int f4(int *p) {
unsigned x = (unsigned) p;
if (x)
return 1;
int *q = (int*) x;
return *q;
}
```
and invoked via:
`clang -c --analyze <file.c>`
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8VFGP4jYQ_jXmZUSUOCTAAw9sWKSTrlKl3V4fq0kySXxr7NTjANtfX9mB3bsWHULI2DOfP38z3yCz6g3RThRPojgscPKDdbsBB7PEmpXxi9q277svgCeg60hOkWmU6aFxyAMxCLlh6k9kPHplDXQ4ac9wGchAPSntARkcaUImONmWhNwCviEgM7lbitKTowD1OE3Ip89wDgAxbuJAxA8EjUbTAwcKDaBB_f4PObAG_lSmtRdORHoQ6X7-_QLeKWrh69dvv0FWClkBmhZQs41ghi7EHs7kOLCzHdQOTTPc6Qh5zMrkKvInqK0fIn2R38BFmd6-8e9M7A6VlUmayPnkFV1PXuR7uG7Kv8rVcmyWl5nt8sTn5hY1OMI26hbugNGyuj686eHm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