correctcomputation / checkedc-clang

This is the primary development repository for 3C, a tool for automatically converting legacy C code to the Checked C extension of C, which aims to enforce spatial memory safety. This repository is a fork of Checked C's.
14 stars 5 forks source link

Use bounds(unknown) rather than an locally-undefined variable copied from function parameter #717

Closed kyleheadley closed 3 years ago

kyleheadley commented 3 years ago

This fix is mostly to convert benchmark errors into bounds errors for easy classification, but the logic being removed was flawed anyway (see #524). Also fixes #712. Additionally, replaced byte_count(0) with bounds(unknown), which required updating tests.

Tests were regenerated using the three scripts, which rewrote all the generated tests and half the others. I manually changed the last 2-3 tests.

3C/itype_nt_arr_cast.c needed to have the clang run disabled because the different bounds were no longer sufficient for the compiler. But since the test comment mentioned a checkedc error without describing it, I need to defer to others for any better solution there.