[PATCH] D42396: [analyzer] Do not attempt to get the pointee of void* .

Artem Dergachev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 22 15:23:14 PST 2018


NoQ added a comment.

Hmm, the original code seems quite quick-and-dirty. It, indeed, tries to blindly dereference something that's accidentally "some pointer".

Could you change the type check to consider AST types instead, i.e. check that `(*I)->getType()` is a double-pointer type? And then pass its single-pointee type into `getSVal` as the second optional argument, so that it knew what to expect. This would be the correct way to express what the author was trying to say.

Because your code ignores possible layers of sub-regions contained within `Reg`, and i'm afraid we may loose notes because of that.

(in any case there are many more ways in which a pointer can be passed into a function that this visitor doesn't pattern-match, but that's not super problematic)


Repository:
  rL LLVM

https://reviews.llvm.org/D42396





More information about the llvm-commits mailing list