Browse Source

* allow <const. node> -> <struct. type> type casts for internal type cast nodes, this is required by the softfloat code generator, it was forbidden by rev. 8369

git-svn-id: trunk@8504 -
florian 18 years ago
parent
commit
0a50052802
1 changed files with 8 additions and 3 deletions
  1. 8 3
      compiler/ncnv.pas

+ 8 - 3
compiler/ncnv.pas

@@ -1802,10 +1802,15 @@ implementation
                                  not(is_open_array(left.resultdef)) and
                                  not(is_open_array(left.resultdef)) and
                                  not(is_array_constructor(left.resultdef)) and
                                  not(is_array_constructor(left.resultdef)) and
                                  (left.resultdef.size=resultdef.size) and
                                  (left.resultdef.size=resultdef.size) and
+                                 { disallow casts of const nodes }
                                  (not is_constnode(left) or
                                  (not is_constnode(left) or
-                                  (not(resultdef.typ in [arraydef,recorddef,setdef,stringdef,
-                                                         filedef,variantdef,objectdef]) or
-                                   is_class_or_interface(resultdef)))
+                                   { however, there are some exceptions }
+                                   (not(resultdef.typ in [arraydef,recorddef,setdef,stringdef,
+                                                          filedef,variantdef,objectdef]) or
+                                   is_class_or_interface(resultdef) or
+                                   { the softfloat code generates casts <const. float> to record }
+                                   (nf_internal in flags)
+                                 ))
                                 ) or
                                 ) or
                                 (
                                 (
                                  is_void(left.resultdef)  and
                                  is_void(left.resultdef)  and