mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-14 17:21:20 +02:00
* generate no exit code at all on x86-64 if the subroutine is compiled with po_noreturn
This commit is contained in:
parent
e65b822a0c
commit
0b3fb55c6a
@ -369,6 +369,12 @@ unit cgcpu;
|
||||
r : longint;
|
||||
regs_to_save_mm: tcpuregisterarray;
|
||||
begin
|
||||
{ if a subroutine is marked as non-returning, we do
|
||||
not generate any exit code, so we really trust the noreturn directive
|
||||
}
|
||||
if po_noreturn in current_procinfo.procdef.procoptions then
|
||||
exit;
|
||||
|
||||
regs_to_save_mm:=paramanager.get_saved_registers_mm(current_procinfo.procdef.proccalloption);
|
||||
{ Prevent return address from a possible call from ending up in the epilogue }
|
||||
{ (restoring registers happens before epilogue, providing necessary padding) }
|
||||
|
Loading…
Reference in New Issue
Block a user