<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61884>61884</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang static analyzer] core.NullDereference false positive with `*p`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hallo-wereld
</td>
</tr>
</table>
<pre>
version: clang trunk
args: `--analyze -Xclang -analyzer-stats -Xclang -analyzer-checker=core,debug.ExprInspection`
`[core.NullDereference]` appears when the if branch is non-reachable, however `[core.NullDereference] ` disappears when the if branch is reachable. In both cases, the `p` is not a null pointer.
See it live:
https://godbolt.org/z/P46z5eYxr
https://godbolt.org/z/df4E8cPoP
Thanks!
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMUk1vnDAU_DXm8gQy5mPhwCHpBimXKlJ7aI_GPLC7XhvZZjfZX1-ZzbarKop6AWneeOZ9DPdezQaxI9UjqfYJX4O0rpNca5ue0aEek8GOb90JnVfWkOIBhOZmhuBWcyB0T-gDd7OPBVLTNOWG67cLQvrjyrsBLvWBB_8BLiSKAzpS7IV1SNiXEYd1zp5eF_ds_IIiROOaXs3evzUl1WPkZ19XrffocEKHRiCp9qSmwJcFufNwlmggSAQ1weC4ERKUB2NN6pALyQcdHUHaM57Qwae6sQqj8p9r_9HN4NnAYIMEwT36aBPJpKZLFNraCMDBrFrDYpUJ6LL7Ib8hggqg1Qm39W6gDGGJ2yasJ6yf7ThYHTLrZsL6C2H9S1lfKvz56v6PPk7lUyNe7Mu98XfJzcETlt-DydgVY1u0PMEurxtaFHW5o4ns6mmYdm2LKPISMd9VfKyo2I2smZq2LYpEdYyygpY0pw3dVTSbWNuWTFQ1a0XJsCQlxSNXOtP6dIzNJcr7Fbs6b5oy0XxA7W8JdV0kpcM6e1JSrXzwf58FFfSW5WvGYuKUgFvS4gk_Oi1MXHuExXoV1AnhrILcksAe4qWS1enunz2qINchE_ZIWB_d33_p4uwvFIGwfpvAE9ZvQ_wOAAD__35-FpY">