mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-10 16:18:28 +02:00
* throw an internal error if the reference of lea contains a segment register
This commit is contained in:
parent
3a81f5c732
commit
1cd8c249b1
@ -4892,9 +4892,12 @@ unit aoptx86;
|
||||
Multiple: TCGInt;
|
||||
begin
|
||||
Result:=false;
|
||||
{ removes seg register prefixes from LEA operations, as they
|
||||
don't do anything}
|
||||
taicpu(p).oper[0]^.ref^.Segment:=NR_NO;
|
||||
|
||||
{ play save and throw an error if LEA uses a seg register prefix,
|
||||
this is most likely an error somewhere else }
|
||||
if taicpu(p).oper[0]^.ref^.Segment<>NR_NO then
|
||||
internalerror(2022022001);
|
||||
|
||||
{ changes "lea (%reg1), %reg2" into "mov %reg1, %reg2" }
|
||||
if (taicpu(p).oper[0]^.ref^.base <> NR_NO) and
|
||||
(taicpu(p).oper[0]^.ref^.index = NR_NO) and
|
||||
|
Loading…
Reference in New Issue
Block a user