<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/64920>64920</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [analyzer] ArrayBound constraint assumption and size type inconsistency within DynamicExtent
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          danix800
      </td>
    </tr>
</table>

<pre>
    Size type inconsistency can be observed in several places:
https://github.com/llvm/llvm-project/blob/bcabaa5590052d1e9f78522a1f45621fe1a95b06/clang/test/Analysis/flexible-array-members.c#L127-L131
same API gives different result types, this can cause problems like, using
https://github.com/llvm/llvm-project/blob/bcabaa5590052d1e9f78522a1f45621fe1a95b06/clang/test/Analysis/array-bound-v2-constraint-check.c#L78C6-L84
as a base, the following example
```c
void symbolic_longlong_and_int0(long long len) {
  char *a = malloc(5);
  (void)a[len + 1]; // no-warning
  // len: [-1,3]
  clang_analyzer_eval(-1 <= len && len <= 3); // expected-warning {{TRUE}}
  clang_analyzer_eval(0 <= len); // expected-warning {{UNKNOWN}}
  clang_analyzer_eval(len <= 2); // expected-warning {{UNKNOWN}}
}
```
with `DynamicMemoryModeling` turned on, the second warning does not
hold anymore, `0 <= len` will be reported as `TRUE` which might not be expected.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVEGv2zYM_jXKhXAg07FjH3JIXhpgWNsN24odH2iJibXKUiDJeS_99YPspu0OG7qdBjixadL8-JHiRzGai2Peifog6uOKpjT4sNPkzGsr5ar3-r771XxiSPcrg3HKu2hiYqfuoMhBz-D7yOHGGoyDyDcOZOFqSXEU1V7Io5D7IaXrbOFJ4Oli0jD1a-VHgSdrb49bcQ3-D1ZJ4Km3vs83RT1RXXdS1qhL7s7btkak8rypGyzPXFJX97IReFKW3EXgKXHMCfaO7D2aKPB0tvxqessFhUD3YuS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