gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSInvocation


From: Richard Frith-Macdonald
Subject: Re: NSInvocation
Date: Tue, 31 Mar 2009 17:06:30 +0100


On 30 Mar 2009, at 14:55, David Chisnall wrote:

Hi,

I'm looking at lines 1032--1038 of NSInvocation.m:

               struct {
                 char  x[size];
               } dummy;
               dummy = va_arg(ap, typeof(dummy));
               memcpy(datum, dummy.x, size);

This will only work in cases where the arguments are all passed on the stack, so won't work for structures containing floating point, vector, or integer arguments where there is still space in the registers, and will cause stack corruption in the case where this is not what happens. I am trying to work out why this code exists at all, since ffi and ffcall contain routines for doing this safely.

This appears to be an unused method, and the comments in the header clearly document it as private, not for external use, so I guess it's just legacy code from ancient times before ffcall and ffi. I have therefore removed the whole method.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]