-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
It would be good to avoid wrapping every pointer in Option
unless the C side had explicit null checks or assignments. The checks are currently represented as .is_null()
, but none of our benchmarks seem to contain any null assignments. A naive way of doing it might be easy to implement, but to be rigorous we'd need to consider control flow to catch cases like this:
fn f() -> *mut T {
let mut p = ...;
if p.is_null() {
p = malloc(...);
}
return p;
}
here, p could be null at the start of the function, but we can show that it isn't null when it's returned, so it's best to conclude that this function can't return null. It seems likely to me that SSA would help with this. I'll have a go at implementing this, but any thoughts on it are welcome
Metadata
Metadata
Assignees
Labels
No labels