mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 09:51:50 +02:00
* fixed get_caller_frame() and get_caller_addr() for nil addresses
git-svn-id: trunk@7470 -
This commit is contained in:
parent
4919cecb3b
commit
4f95f742f4
@ -73,21 +73,29 @@ function get_frame:pointer;assembler;nostackframe;
|
|||||||
function get_caller_addr(framebp:pointer):pointer;assembler;nostackframe;
|
function get_caller_addr(framebp:pointer):pointer;assembler;nostackframe;
|
||||||
asm
|
asm
|
||||||
{ framebp = %o0 }
|
{ framebp = %o0 }
|
||||||
|
subcc %o0,0,%o0
|
||||||
|
be .Lframezero
|
||||||
|
nop
|
||||||
{ flush register windows, so they are stored in the stack }
|
{ flush register windows, so they are stored in the stack }
|
||||||
ta 3
|
ta 3
|
||||||
ld [%o0+60],%o0
|
ld [%o0+60],%o0
|
||||||
{ add 8 to skip jmpl and delay slot }
|
{ add 8 to skip jmpl and delay slot }
|
||||||
add %o0,8,%o0
|
add %o0,8,%o0
|
||||||
|
.Lframezero:
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{$define FPC_SYSTEM_HAS_GET_CALLER_FRAME}
|
{$define FPC_SYSTEM_HAS_GET_CALLER_FRAME}
|
||||||
function get_caller_frame(framebp:pointer):pointer;assembler;nostackframe;
|
function get_caller_frame(framebp:pointer):pointer;assembler;nostackframe;
|
||||||
asm
|
asm
|
||||||
|
{ framebp = %o0 }
|
||||||
|
subcc %o0,0,%o0
|
||||||
|
be .Lframezero
|
||||||
|
nop
|
||||||
{ flush register windows, so they are stored in the stack }
|
{ flush register windows, so they are stored in the stack }
|
||||||
ta 3
|
ta 3
|
||||||
{ framebp = %o0 }
|
|
||||||
ld [%o0+56],%o0
|
ld [%o0+56],%o0
|
||||||
|
.Lframezero:
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user