Просмотр исходного кода

* fixed LLVM type checking of typed files in ISO mode (fixes webtbs/tw34848)

git-svn-id: branches/debug_eh@42205 -
Jonas Maebe 6 лет назад
Родитель
Сommit
f1b66a9741
1 измененных файлов с 12 добавлено и 2 удалено
  1. 12 2
      compiler/llvm/nllvmcnv.pas

+ 12 - 2
compiler/llvm/nllvmcnv.pas

@@ -86,7 +86,16 @@ class function tllvmtypeconvnode.target_specific_need_equal_typeconv(fromdef, to
         (todef.typ=procvardef)) or
        { same for two different specialisations }
        ((df_specialization in fromdef.defoptions) and
-        (df_specialization in todef.defoptions))
+        (df_specialization in todef.defoptions)) or
+       { typed from/to untyped filedef in ISO mode: have to keep because of
+         the get/put buffer }
+       ((fromdef.typ=filedef) and
+        (tfiledef(fromdef).filetyp=ft_typed) and
+        (todef.typ=filedef) and
+        (tfiledef(todef).filetyp=ft_typed) and
+        (not equal_defs(tfiledef(fromdef).typedfiledef, tfiledef(todef).typedfiledef) or
+         target_specific_need_equal_typeconv(tfiledef(fromdef).typedfiledef, tfiledef(todef).typedfiledef))
+       )
       );
   end;
 
@@ -278,7 +287,8 @@ procedure tllvmtypeconvnode.second_nothing;
                (left.resultdef.typ=filedef) and
                (tfiledef(left.resultdef).filetyp=ft_typed) and
                (resultdef.typ=filedef) and
-               (tfiledef(resultdef).filetyp=ft_untyped)
+               (tfiledef(resultdef).filetyp in [ft_untyped,ft_typed]) and
+               (resultdef.size<left.resultdef.size)
            ) and
            { anything else with different size that ends up here is an error }
            (left.resultdef.size<>resultdef.size) then