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

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to