Skip to content

Bounds Widening: Fix handling of bounds variables for nt_array_ptrs #894

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

Closed
secure-sw-dev-bot opened this issue Jan 16, 2022 · 0 comments
Closed

Comments

@secure-sw-dev-bot
Copy link

This issue was copied from checkedc/checkedc-clang#898


There were 3 issues with the handling of variables used in the declared bounds
of an nt_array_ptr:

  1. Bounds variables were being determined only for nt_array_ptrs declared in
    the current block. As a result, if a variable is killed in a block then the
    widened bounds in the successor blocks could not be killed. This is fixed by
    storing the bounds variables along with the nt_array_ptrs for the entire
    function instead of per block.

  2. Bounds variables for function parameters were not getting determined
    correctly. This is fixed by uniforming the logic to determine bounds
    variables for function parameters and local variables.

  3. Bounds declared as CountBoundsExpr were not being handled. This is fixed by
    reading the NormalizedBounds instead of invoking ExpandBoundsToRange.

Also performed minor NFC code cleanups.

Fixes checkedc/checkedc-clang#895

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant