瀏覽代碼

* fixed type information for C-block typed constants (fixes
tests/test/tblock1.pp for llvm)

git-svn-id: trunk@34152 -

Jonas Maebe 9 年之前
父節點
當前提交
68cbbe677a
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      compiler/ngtcon.pas

+ 6 - 2
compiler/ngtcon.pas

@@ -1343,8 +1343,12 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
           end;
         { in case of a nested procdef initialised with a global routine }
         ftcb.maybe_begin_aggregate(def);
-        { to handle type conversions }
-        procaddrdef:=cprocvardef.getreusableprocaddr(def);
+        { get the address of the procedure, except if it's a C-block (then we
+          we will end up with a record that represents the C-block) }
+        if not is_block(def) then
+          procaddrdef:=cprocvardef.getreusableprocaddr(def)
+        else
+          procaddrdef:=def;
         ftcb.queue_init(procaddrdef);
         { remove typeconvs, that will normally insert a lea
           instruction which is not necessary for us }