瀏覽代碼

* ensure that necessary padding bytes in a non-anonymous aggregate are added
before any nested aggregate

git-svn-id: trunk@32521 -

Jonas Maebe 9 年之前
父節點
當前提交
1d460eebc1
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      compiler/llvm/nllvmtcon.pas

+ 4 - 2
compiler/llvm/nllvmtcon.pas

@@ -375,12 +375,14 @@ implementation
           { either add to the current typed const aggregate (if nested), or
             emit to the asmlist (if top level) }
           curagg:=tllvmaggregateinformation(curagginfo);
+          { create aggregate information for this new aggregate }
+          inherited;
+          { only add the new aggregate to the previous aggregate now, because
+            the inherited call may have had to add padding bytes first }
           if assigned(curagg) then
             curagg.aggai.addvalue(agg)
           else
             fasmlist.concat(agg);
-          { create aggregate information for this new aggregate }
-          inherited;
           { set new current typed const aggregate }
           tllvmaggregateinformation(curagginfo).aggai:=agg
         end