mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-06 20:18:31 +02:00
* also consider jump tables embedded in the code when calculating the
distance between a jump and its target git-svn-id: trunk@11022 -
This commit is contained in:
parent
6d9eeaf0f0
commit
942c91afad
@ -504,8 +504,17 @@ uses cutils, cclasses;
|
|||||||
labelpositions.count := tai_label(p).labsym.labelnr * 2;
|
labelpositions.count := tai_label(p).labsym.labelnr * 2;
|
||||||
labelpositions[tai_label(p).labsym.labelnr] := pointer(instrpos);
|
labelpositions[tai_label(p).labsym.labelnr] := pointer(instrpos);
|
||||||
end;
|
end;
|
||||||
if p.typ = ait_instruction then
|
{ ait_const is for jump tables }
|
||||||
|
case p.typ of
|
||||||
|
ait_instruction:
|
||||||
inc(instrpos);
|
inc(instrpos);
|
||||||
|
ait_const:
|
||||||
|
begin
|
||||||
|
if (tai_const(p).consttype<>aitconst_32bit) then
|
||||||
|
internalerror(2008052101);
|
||||||
|
inc(instrpos);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
p := tai(p.next);
|
p := tai(p.next);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -571,6 +580,8 @@ uses cutils, cclasses;
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
ait_const:
|
||||||
|
inc(instrpos);
|
||||||
end;
|
end;
|
||||||
p := tai(p.next);
|
p := tai(p.next);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user