Fix for arrays containing structs will null pointers #1009
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We now allow finding a null pointer at any point in the removal process (previously we were just excepting it in an array of pointers). This fixes diffblue/cbmc-toyota#128
This slightly changes the behaviour in the event we can precisely resolve a null pointer. Previously we would have replaced the function pointer with a branch on all valid function pointers. Now we will (providing --pointer-check is enabled) simply assert false.
This behaviour is more desirable - if we know a pointer is NULL then the previous if statements that were generated would all be ignored anyway, so this just reduces the size of the goto program with no impact on its behaviour.
Pointers to not functions still cause a rejection, so tests that exhibit this have been modified to require this. I am not sure this is correct as I think it makes the behaviour a little inconsistent.
Between this PR and #1007 the PR #936 can be removed since the tests it adds are included in these PRs. Further - they are actually fixed!