immunant / c2rust

Migrate C code to Rust
https://c2rust.com/
Other
3.95k stars 234 forks source link

(`c2rust-analyze`) Remove `UNIQUE` from initial ptr perms before asserting it's empty #981

Closed kkysen closed 1 year ago

kkysen commented 1 year ago

All the ptr perms are initialized to UNIQUE, which we forgot in a396cde371c8b22084b2e10557bed571534db6bf. Since we know the perms exactly, we should be able to overwrite this, but we need to remove UNIQUE before asserting the initial perms are empty.

This also truncates the c2rust-analyze output printed to stderr when it's super long to avoid lagging stderr. The full output is always available in *.analysis.txt and the first and last 50000 chars are printed instead now. The test that was failing was lighttpd_minimal, which has a huge *.analysis.txt, and that made it much harder to find the actual error, so I added this.