[fpc-pascal] (no subject)

Jonas Maebe jonas.maebe at elis.ugent.be
Sat Mar 8 12:51:06 CET 2014


On 07 Mar 2014, at 20:26, Barracuda wrote:

> ---------------------------------------------------------
> function SentenceSample(N: integer): string; stdcall;
> begin
>  //writeln('N = ', N);
>  //SentenceSample := RuGetSentence(N);
>  inc(N);
> end;
> ---------------------------------------------
[snip]
> ---------------------------------------------
> As you can see, procedure has only one parameter, but FPC generates code as if there are two 
> parameters; and the main problem is that it trying to work with wrong variable (N is in ebp+08, 
> not 0C; it's obvious and proved by debugging). The result is bad =)
> So, can you say, there am I wrong?

Ansistrings results are returned in a hidden call-by-reference parameter, so the offset should be correct.


Jonas




More information about the fpc-pascal mailing list