Page MenuHomePhabricator

[analyzer] suppress nullability inference from a macro when result is used in another macro

Authored by george.karpenkov on Jan 4 2018, 5:08 PM.



The current code used to not suppress the report, if the dereference was performed in a macro, assuming it is that same macro.
However, the assumption might not be correct, and XNU has quite a bit of code where dereference is actually performed in a different macro.

As the code uses macro name and not a unique identifier it might be fragile, but in a worst-case scenario we would simply emit an extra diagnostic.


Diff Detail

rC Clang

Event Timeline

NoQ accepted this revision.Jan 5 2018, 6:16 PM

This makes sense. @dcoughlin: does this harmonize with your original intent for adding this suppression in the first place?

This revision is now accepted and ready to land.Jan 5 2018, 6:16 PM
dcoughlin accepted this revision.Jan 8 2018, 4:58 PM

Yes, this looks great!

This revision was automatically updated to reflect the committed changes.