Browse Source

* don't push high value for open array with cdecl;external;

peter 24 years ago
parent
commit
d61f29c799
2 changed files with 18 additions and 14 deletions
  1. 10 12
      compiler/i386/n386cal.pas
  2. 8 2
      compiler/ncal.pas

+ 10 - 12
compiler/i386/n386cal.pas

@@ -77,17 +77,12 @@ implementation
            { open array ? }
            { defcoll.data can be nil for read/write }
            if assigned(defcoll.paratype.def) and
-              push_high_param(defcoll.paratype.def) then
-             begin
-               if assigned(hightree) then
-                begin
-                  secondpass(hightree);
-                  { this is a longint anyway ! }
-                  push_value_para(hightree,inlined,false,para_offset,4);
-                end
-               else
-                internalerror(432645);
-             end;
+              assigned(hightree) then
+            begin
+              secondpass(hightree);
+              { this is a longint anyway ! }
+              push_value_para(hightree,inlined,false,para_offset,4);
+            end;
         end;
 
       var
@@ -1590,7 +1585,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.16  2000-12-25 00:07:32  peter
+  Revision 1.17  2001-01-08 21:46:46  peter
+    * don't push high value for open array with cdecl;external;
+
+  Revision 1.16  2000/12/25 00:07:32  peter
     + new tlinkedlist class (merge of old tstringqueue,tcontainer and
       tlinkedlist objects)
 

+ 8 - 2
compiler/ncal.pas

@@ -287,7 +287,10 @@ interface
                  (nf_isproperty in left.flags) then
                 CGMessagePos(left.fileinfo,type_e_argument_cant_be_assigned);
               { generate the high() value tree }
-              if push_high_param(defcoll.paratype.def) then
+              if not(assigned(aktcallprocsym) and
+                     (([pocall_cppdecl,pocall_cdecl]*aktcallprocsym^.definition^.proccalloptions)<>[]) and
+                     (po_external in aktcallprocsym^.definition^.procoptions)) and
+                 push_high_param(defcoll.paratype.def) then
                 gen_high_tree(is_open_string(defcoll.paratype.def));
               if not(is_shortstring(left.resulttype) and
                      is_shortstring(defcoll.paratype.def)) and
@@ -1565,7 +1568,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.21  2000-12-31 11:14:10  jonas
+  Revision 1.22  2001-01-08 21:46:46  peter
+    * don't push high value for open array with cdecl;external;
+
+  Revision 1.21  2000/12/31 11:14:10  jonas
     + implemented/fixed docompare() mathods for all nodes (not tested)
     + nopt.pas, nadd.pas, i386/n386opt.pas: optimized nodes for adding strings
       and constant strings/chars together