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
1 changed files with 4 additions and 5 deletions

View File

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