* corrected detection of the start of variant parts of records

git-svn-id: trunk@14962 -
This commit is contained in:
Jonas Maebe 2010-03-01 19:16:00 +00:00
parent e693b47234
commit 77d5d9435b
3 changed files with 4 additions and 16 deletions

View File

@ -1372,7 +1372,6 @@ implementation
hintsymoptions : tsymoptions;
deprecatedmsg : pshortstring;
semicoloneaten: boolean;
is_first_field: boolean;
{$if defined(powerpc) or defined(powerpc64)}
tempdef: tdef;
is_first_type: boolean;
@ -1380,7 +1379,6 @@ implementation
sl : tpropaccesslist;
begin
recst:=tabstractrecordsymtable(symtablestack.top);
is_first_field:=true;
{$if defined(powerpc) or defined(powerpc64)}
is_first_type:=true;
{$endif powerpc or powerpc64}
@ -1479,13 +1477,6 @@ implementation
deprecatedmsg:=nil;
try_consume_hintdirective(hintsymoptions,deprecatedmsg);
{ mark first field }
if (is_first_field) then
begin
include(tfieldvarsym(sc[0]).varoptions,vo_is_first_field);
is_first_field:=false;
end;
{ update variable type and hints }
for i:=0 to sc.count-1 do
begin
@ -1588,12 +1579,6 @@ implementation
read_anon_type(casetype,true);
if assigned(fieldvs) then
begin
{ mark first field if not yet marked }
if (is_first_field) then
begin
include(fieldvs.varoptions,vo_is_first_field);
is_first_field:=false;
end;
fieldvs.vardef:=casetype;
recst.addfield(fieldvs,recst.currentvisibility);
end;

View File

@ -398,7 +398,7 @@ type
vo_is_weak_external,
{ Objective-C message selector parameter }
vo_is_msgsel,
{ first field of a record or variant part of a record }
{ first field of variant part of a record }
vo_is_first_field
);
tvaroptions=set of tvaroption;

View File

@ -1047,6 +1047,9 @@ implementation
sym:=TSym(unionst.SymList[i]);
if sym.typ<>fieldvarsym then
internalerror(200601272);
if tfieldvarsym(sym).fieldoffset=0 then
include(tfieldvarsym(sym).varoptions,vo_is_first_field);
{ add to this record symtable }
// unionst.SymList.List.List^[i].Data:=nil;
sym.ChangeOwner(self);