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

Joost van der Sluis joost at cnoc.nl
Thu Aug 5 17:18:26 CEST 2010


On Thu, 2010-08-05 at 16:01 +0200, Jonas Maebe wrote:
> 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
>       ret
> 
>       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.
> ***

I didn't found the code yet, changed the 'call' to 'jmp' by editing the
assembly-file. So I didn't saw the comment.

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

Ok, I'll try if I can fix this now, thanks for the help.

Joost




More information about the fpc-devel mailing list