Browse Source

* Fix bug #9261.

git-svn-id: trunk@8056 -
daniel 18 năm trước cách đây
mục cha
commit
4a3870eb12
2 tập tin đã thay đổi với 19 bổ sung3 xóa
  1. 7 2
      compiler/defutil.pas
  2. 12 1
      compiler/x86_64/cpupara.pas

+ 7 - 2
compiler/defutil.pas

@@ -897,9 +897,14 @@ implementation
             begin
               if tprocvardef(def).is_methodpointer and
                  (not tprocvardef(def).is_addressonly) then
-                result := OS_64
+                if (sizeof(aint) = 4) then
+                  result:=OS_64
+                else if (sizeof(aint) = 8) then
+                  result:=OS_128
+                else
+                  internalerror(200707141)
               else
-                result := OS_ADDR;
+                result:=OS_ADDR;
             end;
           stringdef :
             begin

+ 12 - 1
compiler/x86_64/cpupara.pas

@@ -517,7 +517,18 @@ unit cpupara;
                         begin
                           paraloc:=hp.paraloc[side].add_location;
                           paraloc^.loc:=LOC_REFERENCE;
-                          if paracgsize in [OS_F32,OS_F64,OS_F80,OS_F128] then
+                          {Hack alert!!! We should modify int_cgsize to handle OS_128,
+                           however, since int_cgsize is called in many places in the
+                           compiler where only a few can already handle OS_128, fixing it
+                           properly is out of the question to release 2.2.0 in time. (DM)}
+                          if paracgsize=OS_128 then
+                            if paralen=8 then
+                              paraloc^.size:=OS_64
+                            else if paralen=16 then
+                              paraloc^.size:=OS_128
+                            else
+                              internalerror(200707143)
+                          else if paracgsize in [OS_F32,OS_F64,OS_F80,OS_F128] then
                             paraloc^.size:=int_float_cgsize(paralen)
                           else
                             paraloc^.size:=int_cgsize(paralen);