Selaa lähdekoodia

* when emitting the procedure address part of a complex procvar, type
that address as an "address-only" procvar instead of supposedly
emitting a complex procvar itself as the address part of that same
complex procvar type (part of fixing test/tmaclocalprocparam4e.pp
for llvm)

git-svn-id: trunk@34117 -

Jonas Maebe 9 vuotta sitten
vanhempi
commit
c71bc54785
1 muutettua tiedostoa jossa 5 lisäystä ja 3 poistoa
  1. 5 3
      compiler/ngtcon.pas

+ 5 - 3
compiler/ngtcon.pas

@@ -1307,7 +1307,8 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
     procedure tasmlisttypedconstbuilder.parse_procvardef(def:tprocvardef);
     procedure tasmlisttypedconstbuilder.parse_procvardef(def:tprocvardef);
       var
       var
         tmpn,n : tnode;
         tmpn,n : tnode;
-        pd   : tprocdef;
+        pd : tprocdef;
+        procaddrdef: tprocvardef;
         havepd,
         havepd,
         haveblock: boolean;
         haveblock: boolean;
       begin
       begin
@@ -1349,7 +1350,8 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
         { in case of a nested procdef initialised with a global routine }
         { in case of a nested procdef initialised with a global routine }
         ftcb.maybe_begin_aggregate(def);
         ftcb.maybe_begin_aggregate(def);
         { to handle type conversions }
         { to handle type conversions }
-        ftcb.queue_init(def);
+        procaddrdef:=cprocvardef.getreusableprocaddr(def);
+        ftcb.queue_init(procaddrdef);
         { remove typeconvs, that will normally insert a lea
         { remove typeconvs, that will normally insert a lea
           instruction which is not necessary for us }
           instruction which is not necessary for us }
         while n.nodetype=typeconvn do
         while n.nodetype=typeconvn do
@@ -1403,7 +1405,7 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
           end
           end
         else if n.nodetype=pointerconstn then
         else if n.nodetype=pointerconstn then
           begin
           begin
-            ftcb.queue_emit_ordconst(tpointerconstnode(n).value,def);
+            ftcb.queue_emit_ordconst(tpointerconstnode(n).value,procaddrdef);
             if not def.is_addressonly then
             if not def.is_addressonly then
               ftcb.emit_tai(Tai_const.Create_sym(nil),voidpointertype);
               ftcb.emit_tai(Tai_const.Create_sym(nil),voidpointertype);
           end
           end