瀏覽代碼

LLVM: fix variant records when alignment of first part is not the highest

Resolves #40015
Jonas Maebe 2 年之前
父節點
當前提交
c5f4a6acd0
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      compiler/symtable.pas

+ 2 - 1
compiler/symtable.pas

@@ -2288,7 +2288,8 @@ implementation
                 if (varcount>=variantstarts.count) then
                   internalerror(2008051005);
                 { new variant part -> use the one with the biggest alignment }
-                i:=tempsymlist.indexof(tobject(variantstarts[varcount]));
+                fieldvs:=tfieldvarsym(variantstarts[varcount]);
+                i:=tempsymlist.indexof(fieldvs);
                 lastvaroffsetprocessed:=fieldvs.fieldoffset;
                 inc(varcount);
                 if (i<0) then