Browse Source

* constant array type conversion fixed

peter 26 years ago
parent
commit
878b1b28e6
1 changed files with 24 additions and 24 deletions
  1. 24 24
      compiler/tccal.pas

+ 24 - 24
compiler/tccal.pas

@@ -180,6 +180,25 @@ implementation
                  (defcoll^.paratype.def^.deftype=setdef) then
                  (defcoll^.paratype.def^.deftype=setdef) then
                 p^.left:=gentypeconvnode(p^.left,defcoll^.paratype.def);
                 p^.left:=gentypeconvnode(p^.left,defcoll^.paratype.def);
 
 
+              { set some settings needed for arrayconstructor }
+              if is_array_constructor(p^.left^.resulttype) then
+               begin
+                 if is_array_of_const(defcoll^.paratype.def) then
+                  begin
+                    if assigned(aktcallprocsym) and
+                       (pocall_cdecl in aktcallprocsym^.definition^.proccalloptions) and
+                       (po_external in aktcallprocsym^.definition^.procoptions) then
+                      p^.left^.cargs:=true;
+                    { force variant array }
+                    p^.left^.forcevaria:=true;
+                  end
+                 else
+                  begin
+                    p^.left^.novariaallowed:=true;
+                    p^.left^.constructdef:=parraydef(defcoll^.paratype.def)^.elementtype.def;
+                  end;
+               end;
+
               if do_count then
               if do_count then
                begin
                begin
                  { not completly proper, but avoids some warnings }
                  { not completly proper, but avoids some warnings }
@@ -256,29 +275,7 @@ implementation
                           CGMessagePos2(p^.left^.fileinfo,parser_e_call_by_ref_without_typeconv,
                           CGMessagePos2(p^.left^.fileinfo,parser_e_call_by_ref_without_typeconv,
                             p^.left^.resulttype^.typename,defcoll^.paratype.def^.typename);
                             p^.left^.resulttype^.typename,defcoll^.paratype.def^.typename);
                        end;
                        end;
-                   { process cargs arrayconstructor }
-                   if is_array_constructor(p^.left^.resulttype) then
-                    begin
-                      if is_array_of_const(defcoll^.paratype.def) then
-                       begin
-                         if assigned(aktcallprocsym) and
-                            (pocall_cdecl in aktcallprocsym^.definition^.proccalloptions) and
-                            (po_external in aktcallprocsym^.definition^.procoptions) then
-                           p^.left^.cargs:=true;
-                         { force variant array }
-                         p^.left^.forcevaria:=true;
-                       end
-                      else
-                       begin
-                         p^.left^.novariaallowed:=true;
-                         p^.left^.constructdef:=parraydef(defcoll^.paratype.def)^.elementtype.def;
-                       end;
-                      old_array_constructor:=allow_array_constructor;
-                      allow_array_constructor:=true;
-                      firstpass(p^.left);
-                      allow_array_constructor:=old_array_constructor;
-                    end;
-                   { process open parameters }
+                   { Process open parameters }
                    if push_high_param(defcoll^.paratype.def) then
                    if push_high_param(defcoll^.paratype.def) then
                     begin
                     begin
                       { insert type conv but hold the ranges of the array }
                       { insert type conv but hold the ranges of the array }
@@ -1223,7 +1220,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.75  1999-12-09 23:18:04  pierre
+  Revision 1.76  1999-12-19 15:13:56  peter
+    * constant array type conversion fixed
+
+  Revision 1.75  1999/12/09 23:18:04  pierre
    * no_fast_exit if procedure contains implicit termination code
    * no_fast_exit if procedure contains implicit termination code
 
 
   Revision 1.74  1999/11/30 10:40:57  peter
   Revision 1.74  1999/11/30 10:40:57  peter