This is an archive of the discontinued LLVM Phabricator instance.

Only issue warning for subtraction involving null pointers on live code paths
ClosedPublic

Authored by jamieschmeiser on Jun 1 2022, 1:20 PM.

Details

Summary

Change the warning produced for subtraction from (or with) a null pointer
to only be produced when the code path is live.

Respond to review comments: add cpp test.

Diff Detail

Event Timeline

jamieschmeiser created this revision.Jun 1 2022, 1:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2022, 1:20 PM
jamieschmeiser requested review of this revision.Jun 1 2022, 1:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2022, 1:20 PM
efriedma accepted this revision.Jun 1 2022, 1:28 PM

LGTM

This revision is now accepted and ready to land.Jun 1 2022, 1:28 PM

So far the tests in pointer-subtraction.c are mirrored in pointer-subtraction.cpp - worth continuing to do?

jamieschmeiser edited the summary of this revision. (Show Details)

Respond to review comments: add cpp test.

This revision was landed with ongoing or failed builds.Jun 3 2022, 7:12 AM
This revision was automatically updated to reflect the committed changes.