* 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:
Jonas Maebe 2020-01-29 22:21:21 +00:00
parent 254b85c352
commit d9f4c85d2e

View File

@ -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;