NoQ added a comment.

In D120992#3359864 <https://reviews.llvm.org/D120992#3359864>, @steakhal wrote:

> BTW what is the semantics of `[p retain]` in ObjC? Can `p` be null in that 
> context? Or does it count as a dereferences, hence it constraints the pointer?

In Objective-C "methods" can be "called" on null pointers. The well-defined 
result is that nothing happens and null is returned. If the method returns an 
integer, a zero is returned. If the method returns a structure by value, a 
zero-filled structure is returned. In Objective-C++, if the method returns a 
C++ object by value, a zero-filled object is returned (without calling the 
constructor; in particular, the object may be ill-formed from the start).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120992/new/

https://reviews.llvm.org/D120992

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to