* better checking of valid addr_no

This commit is contained in:
florian 2025-01-02 15:38:07 +01:00
parent 4185e1dc67
commit 8674d45d7b

View File

@ -97,12 +97,13 @@ unit agppcgas;
begin begin
with ref do with ref do
begin begin
if ((offset < -32768) or (offset > 32767)) and
(refaddr = addr_no) then
internalerror(2006052501);
case refaddr of case refaddr of
addr_no: addr_no:
s := ''; begin
if (offset < -32768) or (offset > 32767) or assigned(symbol) then
internalerror(2006052501);
s:='';
end;
addr_pic_no_got: addr_pic_no_got:
begin begin
{ used for TOC-based loads } { used for TOC-based loads }
@ -142,15 +143,15 @@ unit agppcgas;
end; end;
end; end;
if offset<0 then if offset<0 then
s:=s+tostr(offset) s:=s+tostr(offset)
else else
if (offset>0) then if (offset>0) then
begin begin
if assigned(symbol) then if assigned(symbol) then
s:=s+'+'+tostr(offset) s:=s+'+'+tostr(offset)
else else
s:=s+tostr(offset); s:=s+tostr(offset);
end; end;
if not(refaddr in [addr_no,addr_pic_no_got]) then if not(refaddr in [addr_no,addr_pic_no_got]) then
begin begin