[PATCH] D34275: [analyzer] Re-implemente current virtual calls checker in a path-sensitive way

wangxin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 21 04:34:50 PDT 2017


wangxindsb added a comment.

> Oh, I think I see how it works now. How about:

> 
> 
>   struct A;
>   struct X {
>      void callFooOfA(A*);
>   };
>   struct A {
>     A() {
>       X x;
>       x.virtualMethod(); // this virtual call is ok
>       x.callFooOfA(this)
>     }
>     virtual foo();
>   };
>   void X::callFooOfA(A* a) {
>      a->foo(); // Would be good to warn here. 
>   }
>   int main() {
>     A a;
>   }

Yes,  you are right, the checker doesn't warn on the //a->foo();//. I will fix this error soon.

Thanks,
Xin


https://reviews.llvm.org/D34275





More information about the cfe-commits mailing list