Pārlūkot izejas kodu

+ support procvardefs (address only) in i8086's hlcgcpu.getaddressregister; this
fixes e.g. obtaining the address of a method in i8086 far code memory models
after r32414

git-svn-id: trunk@32562 -

nickysn 9 gadi atpakaļ
vecāks
revīzija
1e33924f73
1 mainītis faili ar 9 papildinājumiem un 0 dzēšanām
  1. 9 0
      compiler/i8086/hlcgcpu.pas

+ 9 - 0
compiler/i8086/hlcgcpu.pas

@@ -248,6 +248,15 @@ implementation
       if is_implicit_pointer_object_type(size) or is_implicit_array_pointer(size) then
         size:=voidpointertype;
 
+      { procvars follow the default code pointer size for the current memory model }
+      if size.typ=procvardef then
+        if ((po_methodpointer in tprocvardef(size).procoptions) or
+            is_nested_pd(tprocvardef(size))) and
+           not(po_addressonly in tprocvardef(size).procoptions) then
+          internalerror(2015120101)
+        else
+          size:=voidcodepointertype;
+
       if is_farpointer(size) or is_hugepointer(size) then
         Result:=cg.getintregister(list,OS_32)
       else