2
0
Эх сурвалжийг харах

* use the size of the generated anonymous record instead of the manual tracked size so that any padding is picked up as well

git-svn-id: trunk@42521 -
svenbarth 6 жил өмнө
parent
commit
0b3418e978
1 өөрчлөгдсөн 3 нэмэгдсэн , 5 устгасан
  1. 3 5
      compiler/ncgrtti.pas

+ 3 - 5
compiler/ncgrtti.pas

@@ -1814,7 +1814,6 @@ implementation
         arglab : tasmlabel;
         argdef : tdef;
         i : sizeint;
-        arglen : word;
       begin
         if length(attr.paras)=0 then
           begin
@@ -1830,7 +1829,6 @@ implementation
             argtcb.begin_anonymous_record('',defaultpacking,min(reqalign,SizeOf(PInt)),
               targetinfos[target_info.system]^.alignment.recordalignmin);
 
-            arglen:=0;
             for i:=0 to High(attr.paras) do
               begin
                 case attr.paras[i].nodetype of
@@ -1840,9 +1838,9 @@ implementation
                   stringconstn,
                   pointerconstn,
                   guidconstn:
-                    inc(arglen,tconstnode(attr.paras[i]).emit_data(argtcb));
+                    tconstnode(attr.paras[i]).emit_data(argtcb);
                   setconstn:
-                    inc(arglen,tsetconstnode(attr.paras[i]).emit_data(argtcb));
+                    tsetconstnode(attr.paras[i]).emit_data(argtcb);
                   else
                     internalerror(2019070803);
                 end;
@@ -1857,7 +1855,7 @@ implementation
             argtcb.free;
 
             { write argument size and the reference to the argument entry }
-            tbltcb.emit_ord_const(arglen,u16inttype);
+            tbltcb.emit_ord_const(argdef.size,u16inttype);
             tbltcb.emit_tai(Tai_const.Create_sym(arglab),voidpointertype);
           end;
       end;