Also check for the type of the register when replacing it. In certain circumstances this can still lead to access to invalid memory resulting either in an access violation or invalid registers.

git-svn-id: trunk@22779 -
This commit is contained in:
svenbarth 2012-10-19 19:35:45 +00:00
parent ee62a1ed50
commit d15304c25e

View File

@ -2259,9 +2259,12 @@ unit rgobj;
begin begin
if regtype in [R_INTREGISTER,R_ADDRESSREGISTER] then if regtype in [R_INTREGISTER,R_ADDRESSREGISTER] then
begin begin
{ no need to check for the register type here } if (ref^.base <> NR_NO) and
tryreplacereg(ref^.base); (getregtype(ref^.base)=regtype) then
tryreplacereg(ref^.index); tryreplacereg(ref^.base);
if (ref^.index <> NR_NO) and
(getregtype(ref^.index)=regtype) then
tryreplacereg(ref^.index);
end; end;
end; end;
{$ifdef ARM} {$ifdef ARM}