Skip to content

Add assumption about array index reads #1772

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/user-guide/assumptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,25 @@ _NB! This list is likely incomplete._

This affects the `base` analysis.

See [issue #1770](https://github.com/goblint/analyzer/issues/1770).

4. Array index reads are in bounds.

[C11's N1570][n1570] at J.2 states that

> The behavior is undefined in the following circumstances:
>
> - [...]
> - An array subscript is out of range, even if an object is apparently accessible with the given subscript (as in the lvalue expression `a[1][7]` given the declaration `int a[4][5]`) (6.5.6).

after a long list of undefined behaviors.

Goblint does not by default report reading from out of bounds array indices.
Goblint reports out of bounds array index accesses when the `ana.arrayoob` option is enabled.

This affects the `base` analysis.

See [issue #1702](https://github.com/goblint/analyzer/issues/1702).


[n1570]: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf
Loading