[fpc-devel] Passing parameters through the stack to interfaces

Jonas Maebe jonas.maebe at elis.ugent.be
Thu Aug 5 16:01:04 CEST 2010

On 05 Aug 2010, at 15:18, Joost van der Sluis wrote:

> 1: replace the 'call' in the wrapper with a 'jmp'. I've tried this and
> it works, but when the function returns, the 'self'-class-pointer is  
> not
> converted to the interface-pointer. But I don't see why this is done  
> in
> the first place?!?

It's described in the comments:

(1): The code is the following
      set self parameter to correct value
      call mangledname
      set self parameter to interface value

      This is different to case (0) because in theory, the caller
      could reuse the data pushed on the stack so we've to return
      it unmodified because self is const.

However, at least nowadays self is a value parameter rather than a  
const parameter, so it shouldn't matter anymore.


More information about the fpc-devel mailing list