> From: fpc-devel <fpc-devel-boun...@lists.freepascal.org> On Behalf
> Of J. Gareth Moreton

> For functions with a stack frame, either LEAVE or MOV RSP, RBP; POP
> RBP must precede it.
It's not quite that simple, at least under windows:
https://docs.microsoft.com/en-us/cpp/build/prolog-and-epilog

But yes, this documents that there can be multiple epilogues, so the additional 
ret would be fine in this regard.

Following this exact format is required so that the stack unwinder during 
processing of SEH (structured exception handling) which is performed by the OS 
can correctly restore the value of non-volatile registers that has been saved 
on the stack.

Fortunately, as our function in this case doesn't use the stack at all and 
doesn't contain calls to other functions, this can be skipped.

> So what happens now? Do we submit a patch?
I think Sven Barth was going to fix this up anyway?

Cheers,
Thorsten

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

Reply via email to