Преглед изворни кода

* corrected detection of the start of variant parts of records

git-svn-id: trunk@14962 -
Jonas Maebe пре 15 година
родитељ
комит
77d5d9435b
3 измењених фајлова са 4 додато и 16 уклоњено
  1. 0 15
      compiler/pdecvar.pas
  2. 1 1
      compiler/symconst.pas
  3. 3 0
      compiler/symtable.pas

+ 0 - 15
compiler/pdecvar.pas

@@ -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;

+ 1 - 1
compiler/symconst.pas

@@ -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;

+ 3 - 0
compiler/symtable.pas

@@ -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);