[PATCH] D11433: [Static Analyzer] Make NonNullParamChecker emit implicit null dereference events.

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 17 14:04:56 PDT 2015


xazax.hun added a comment.

The problem here is that, this checker can emit a warning for two cases:
1, Null was bound to a reference which should be reported as a dereference
2, Null was passed to parameter that should be non-null (marked by the attribute, not the qualifier) which should be reported appropriately

Right now exactly the same event will be triggered for both cases, so the checkers that process this event has no information whether it is a dereference or a value passed to a nonnull parameter, so it can not provide appropriate diagnostic for both cases.

One possibility would be to have two separate events, the other is to have an argument to an event that determines its origin. Probably it would be better to have two separate events, since it might be confusing to have dereference in the name of the event in the second case.

What do you think?


http://reviews.llvm.org/D11433





More information about the cfe-commits mailing list