Check for pointer validity when casting raw pointer to reference. #2975
Labels
[C] Feature / Enhancement
A new feature request or enhancement to an existing feature.
[E] Unsupported UB
Undefined behavior that Kani does not detect
T-High Priority
Tag issues that have high priority
Z-Kani Compiler
Issues that require some changes to the compiler
Requested feature: Kani should automatically check if a raw pointer is valid before any conversion to a reference, strengthening the verification of unsafe code.
Use case: This will help enable modular verification of safe abstractions. Kani detects invalid memory access only when the reference or dangling pointer is used.
Link to relevant documentation (Rust reference, Nomicon, RFC):
Test case:
Note: The harness above succeeds under playground run (version 1.75.0), and with Kani, but it correctly fails under MIRI.
The text was updated successfully, but these errors were encountered: