This is just a prototype review for my changes since I thought it will be easier to ask code related doubts here.
I just wanted to share how I prototyped the checker for default constructed unique pointer dereferences.
It is incomplete. Not added tests. Not all cases covered. Reporting part is not proper. This may be a throw away code.
I am sharing this so that if I am fundamentally wrong in any of my directions it will be much better to catch early and rectify.
- Added a two maps to track mem region and corresponding states and Symbols to mem region
- Created a RegionState to track information about the state of memory region whether it is null or not or unknown
- Using PostCall to update the states of mem region
- Using PreCall to check the null pointer dereferences
Few doubts:
I am not sure about whether I should use eval::Call or both check::PreCall and check::PostCall.
In the eval::Call documentation I found this "Note, that only one checker can evaluate a call.". So I am little bit confused about using it.
Using one map for tracking the mem region and states then one more for Symbols to region to track which all Symbol has the inner pointer.
I am just looking is there any better approach for this.
Changed the modeling to SmartPtrModeling and named checker to SmartPtr