* allow also CSUBSETREG in tx86inlinenode.second_IncludeExclude, resolves #38733

git-svn-id: trunk@49151 -
This commit is contained in:
florian 2021-04-09 20:09:19 +00:00
parent ca475537e8
commit b09669dffe
3 changed files with 41 additions and 1 deletions

1
.gitattributes vendored
View File

@ -18775,6 +18775,7 @@ tests/webtbs/tw3865.pp svneol=native#text/plain
tests/webtbs/tw38695.pp svneol=native#text/pascal
tests/webtbs/tw3870.pp svneol=native#text/plain
tests/webtbs/tw38703.pp svneol=native#text/pascal
tests/webtbs/tw38733.pp svneol=native#text/pascal
tests/webtbs/tw3893.pp svneol=native#text/plain
tests/webtbs/tw3898.pp svneol=native#text/plain
tests/webtbs/tw3899.pp svneol=native#text/plain

View File

@ -1075,8 +1075,9 @@ implementation
((tcallparanode(tcallparanode(left).right).left.location.value-setbase) div bitsperop)*tcgsize2size[opsize]);
cg.a_op_const_ref(current_asmdata.CurrAsmList,cgop,opsize,l,tcallparanode(left).left.location.reference);
end;
LOC_CSUBSETREG,
LOC_CREGISTER :
cg.a_op_const_reg(current_asmdata.CurrAsmList,cgop,tcallparanode(left).left.location.size,l,tcallparanode(left).left.location.register);
hlcg.a_op_const_loc(current_asmdata.CurrAsmList,cgop,tcallparanode(left).left.resultdef,l,tcallparanode(left).left.location);
else
internalerror(200405022);
end;

38
tests/webtbs/tw38733.pp Normal file
View File

@ -0,0 +1,38 @@
type
TSimpleEnum = (seOne, seTwo);
TSimpleSet = set of TSimpleEnum;
TRecordWithSet = record
TheSet : TSimpleSet;
end;
function FirstFunc:TRecordWithSet;
begin
FirstFunc.TheSet := [];
//below would work fine
//FirstFunc.TheSet := FirstFunc.TheSet + [seOne];
//below line causes error "Fatal: Internal error 200405022"
Include(FirstFunc.TheSet, seOne);
if not(seOne in FirstFunc.TheSet) then
halt(1);
end;
//absolute variable overlaying Result doesn't help
function SecondFunc:TRecordWithSet;
var
LocalAbs : TRecordWithSet absolute SecondFunc;
begin
LocalAbs.TheSet := [];
//below line would cause same error
Include(LocalAbs.TheSet, seOne);
if not(seOne in LocalAbs.TheSet) then
halt(1);
end;
var
Collected : TRecordWithSet;
begin
Collected := FirstFunc;
end.