From 463594179ffa4ad26e385214ecdefc2ad724d36a Mon Sep 17 00:00:00 2001 From: Andrei Homescu Date: Wed, 24 Apr 2024 22:17:09 -0700 Subject: [PATCH] Use PDG to remove NON_NULL from pointers in static analysis Remove the NON_NULL permission from all nodes in the null graph from the PDG. --- c2rust-analyze/src/analyze.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/c2rust-analyze/src/analyze.rs b/c2rust-analyze/src/analyze.rs index 51f8dc12f0..5b0f4d1ba9 100644 --- a/c2rust-analyze/src/analyze.rs +++ b/c2rust-analyze/src/analyze.rs @@ -1017,7 +1017,10 @@ fn run(tcx: TyCtxt) { if !node_info.unique { perms.remove(PermissionSet::UNIQUE); } - // TODO: PermissionSet::NON_NULL + if g.is_null { + // TODO: is this enough? + perms.remove(PermissionSet::NON_NULL); + } if perms != old_perms { let added = perms & !old_perms;