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.
See that x and y are treated as WILD. They should be checked pointers.
Root cause
We check for sizeof expr using UnaryExprOrTypeTraitExpr, However, If you look at the AST of the argument, there is an implicit cast, which we do not handle:
Consider the following code:
Gets converted to:
See that
x
andy
are treated asWILD
. They should be checked pointers.Root cause
We check for
sizeof
expr usingUnaryExprOrTypeTraitExpr
, However, If you look at the AST of the argument, there is an implicit cast, which we do not handle:Fix
The fix for this is to normalize the expression before checking for
UnaryExpr
:Note: This involves changing various tests.