mbox

[0/2] provide simple detection of indeterminate pointers

Message ID b23da7b4-e782-9ac8-3d28-541b93fc2fd5@gmail.com
Headers

Message

Martin Sebor Nov. 1, 2021, 10:15 p.m. UTC
  This two-patch series adds support for the detection of uses
of pointers invalidated as a result of the lifetime of
the objects they point to having ended: either explicitly,
after a call to a dynamic deallocation function, or implicitly,
by virtue of an object with automatic storage duration having
gone out of scope.

To minimize false positives the initial logic is very simple
(even simplistic): the code only checks uses in basic blocks
dominated by the invalidating calls (either calls to
deallocation functions or GCC's clobbers).

A more thorough checker is certainly possible and I'd say most
desirable but will require a more sophisticated implementation
and a better predicate analyzer than is available, and so will
need to wait for GCC 13.

Martin