Clean up code generated by real negation optimization.

This could read and write a byte beyond the value being modified. This normally would not matter, but theoretically could in some cases involving concurrency.
This commit is contained in:
Stephen Heumann 2021-03-06 23:16:00 -06:00
parent acddd93ffb
commit cf9add4720

View File

@ -609,10 +609,9 @@ var
same := true; same := true;
if same then begin if same then begin
case op^.optype of case op^.optype of
cgReal: disp := 3; cgReal: disp := 2;
cgDouble: disp := 7; cgDouble: disp := 6;
cgExtended: disp := 9; cgExtended: disp := 8;
cgComp: disp := 11;
end; {case} end; {case}
opl^.left^.optype := cgWord; opl^.left^.optype := cgWord;
opl^.left^.q := opl^.left^.q + disp; opl^.left^.q := opl^.left^.q + disp;
@ -621,7 +620,7 @@ var
op2 := pointer(Calloc(sizeof(intermediate_code))); op2 := pointer(Calloc(sizeof(intermediate_code)));
op2^.opcode := pc_ldc; op2^.opcode := pc_ldc;
op2^.optype := cgWord; op2^.optype := cgWord;
op2^.q := $0080; op2^.q := $8000;
opl^.right := op2; opl^.right := op2;
opl^.opcode := pc_bxr; opl^.opcode := pc_bxr;
end {if} end {if}