> If you in some way rely on static types of those pointers, you may be
> in for a number of unpleasant surprises, because these types do not
> really have any meaning at all.

Annotalysis is just a static analyzer, so if the types are somehow
inaccurate (as they are in certain cases), then the only ill effect
will be that the analysis issues a warning where it shouldn't, or
fails to issue a warning where it should.  Of course, no analysis
that's based on types will ever be sound for C++, because C++ is not
type-safe. We merely assume that the declared types represent the
intentions of the programmer, and hope that the declared types are
preserved in gimple with some degree of fidelity.

> Just out of curiosity, I does your
> analysis crash also on the testcase below (add the Mutex field if it
> is necessary)?

No, the static type of b (in b->test()) remains Bar* in gimple, so the
analysis works fine (i.e. the analyzer will not crash).

> Also, I have just very briefly glanced at the code in handle_call_gs
> but still it seems to me that the code dealing with virtual calls
> assumes virtual functions are never overridden...?

It doesn't matter whether it's overridden or not, since any overriding
versions are required to have the same type signature as the original.
 Annotalysis is merely an extended type-checker.

> And pretty please, use -p diff option when creating patches to be posted here.

My apologies; will do.

  -DeLesley

Reply via email to