* type casting could force class variables into sub registers, so handle them in subscript nodes as well

git-svn-id: trunk@23587 -
This commit is contained in:
florian 2013-02-10 10:06:36 +00:00
parent 209bfaa774
commit 77bbb8b5bc
3 changed files with 24 additions and 1 deletions

1
.gitattributes vendored
View File

@ -9784,6 +9784,7 @@ tests/tbs/tb0588.pp svneol=native#text/pascal
tests/tbs/tb0589.pp svneol=native#text/pascal
tests/tbs/tb0590.pp svneol=native#text/pascal
tests/tbs/tb0591.pp svneol=native#text/pascal
tests/tbs/tb0592.pp svneol=native#text/plain
tests/tbs/tb205.pp svneol=native#text/plain
tests/tbs/ub0060.pp svneol=native#text/plain
tests/tbs/ub0069.pp svneol=native#text/plain

View File

@ -324,7 +324,12 @@ implementation
location.reference.base := left.location.register;
end;
LOC_CREFERENCE,
LOC_REFERENCE:
LOC_REFERENCE,
{ tricky type casting of parameters can cause these locations, see tb0592.pp on x86_64-linux }
LOC_SUBSETREG,
LOC_CSUBSETREG,
LOC_SUBSETREF,
LOC_CSUBSETREF:
begin
location.reference.base:=cg.getaddressregister(current_asmdata.CurrAsmList);
hlcg.a_load_loc_reg(current_asmdata.CurrAsmList,left.resultdef,left.resultdef,left.location,location.reference.base);

17
tests/tbs/tb0592.pp Normal file
View File

@ -0,0 +1,17 @@
{$mode objfpc}
type
TT_Stream = record z : Pointer; end;
TFreeTypeStream = class
FUsed : Boolean;
end;
procedure TT_Done_Stream( stream : TT_Stream );
begin
if stream.z = nil then exit;
TFreeTypeStream(stream.z).FUsed := false;
end;
begin
end.