checkedc / checkedc-llvm-project

This was a fork of Checked C clang used from 2021-2024. The changes have been merged into the original Checked C clang repo, which is now at https://github.com/checkedc/checkedc-clang.
https://www.checkedc.org
13 stars 19 forks source link

[BoundsWidening] Determine checked scope specifier per statement #1138

Closed secure-sw-dev-bot closed 2 years ago

secure-sw-dev-bot commented 2 years ago

This issue was copied from https://github.com/microsoft/checkedc-clang/issues/1139


We use the CheckedCAnalysesPrepass.cpp to gather the checked scopes for statements. We store a map of statements to their checked scope specifiers. An entry in this map is only made for the following statements:

  1. For the first non-compound statement of a compound statement.
  2. For the first statement that follows a compound statement.

We then use this info in the bounds widening analysis to determine the checked scope specifiers for each statement.