ObjFW runtime: Add objc_msg_lookup(_super)_{fp,st}ret

Eli Friedman eli.friedman at gmail.com
Mon Jul 8 10:22:09 PDT 2013


On Mon, Jul 8, 2013 at 8:58 AM, Jonathan Schleifer <js at webkeks.org> wrote:

> I just noticed that in this patch, I also handle fpret differently, even
> though that should not be necessary for forwarding (or is there an
> architecture where it is?). The idea was originally that this would make
> sending to nil more robust, however, what an fpret is is highly platform
> dependent. Therefore I'm not sure if also having objc_msg_send_fpret is a
> good idea. Any opinions on that? (I think the compiler should handle nil
> messaging for everything that does not return an integer type - this seems
> to be the only way to always do it right).
>
> If you are going to call a function for nil receivers, you have to have a
specialized fpret form for x86-32: otherwise, the program will misbehave
due to mismatched push/pop on the FP stack.

That said, it wouldn't be unreasonable to just nil-check before any call
that doesn't have an integer/pointer return; on the Mac side, we actually
do such a check anyway for structs because we zero-initialize them.

-Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130708/4178227e/attachment.html>


More information about the cfe-commits mailing list