mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-12 17:09:35 +02:00
* llvm sometimes uses the AArch64 framepointer register as a regvar in the
main routine (because it can never return) -> attempt to guard against invalid accesses in get_caller_addr git-svn-id: trunk@44066 -
This commit is contained in:
parent
254b85c352
commit
d9f4c85d2e
@ -166,7 +166,14 @@ function get_caller_addr(framebp:pointer;addr:pointer=nil):pointer;assembler; no
|
||||
asm
|
||||
cbz x0, .Lcaller_addr_invalid
|
||||
ldur x0, [x0]
|
||||
{$ifndef cpullvm}
|
||||
cbz x0, .Lcaller_addr_invalid
|
||||
{$else cpullvm}
|
||||
movn w1, #0
|
||||
cmp x0, x1
|
||||
csel x0, xzr, x0, ls
|
||||
b.ls .Lcaller_addr_invalid
|
||||
{$endif cpullvm}
|
||||
ldur x0, [x0, #8]
|
||||
.Lcaller_addr_invalid:
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user