浏览代码

* fixed duplicate alias check

git-svn-id: trunk@6003 -
peter 18 年之前
父节点
当前提交
323fc850b9
共有 2 个文件被更改,包括 14 次插入14 次删除
  1. 13 13
      compiler/ncgutil.pas
  2. 1 1
      compiler/systems/t_linux.pas

+ 13 - 13
compiler/ncgutil.pas

@@ -1919,20 +1919,20 @@ implementation
 
     procedure gen_proc_symbol(list:TAsmList);
       var
-        hs : string;
+        item : tstringlistitem;
       begin
-        repeat
-          hs:=current_procinfo.procdef.aliasnames.getfirst;
-          if hs='' then
-            break;
-          if (cs_profile in current_settings.moduleswitches) or
-             (po_global in current_procinfo.procdef.procoptions) then
-            list.concat(Tai_symbol.createname_global(hs,AT_FUNCTION,0))
-          else
-            list.concat(Tai_symbol.createname(hs,AT_FUNCTION,0));
-          if tf_use_function_relative_addresses in target_info.flags then
-            list.concat(Tai_function_name.create(hs));
-        until false;
+        item := tstringlistitem(current_procinfo.procdef.aliasnames.first);
+        while assigned(item) do
+          begin
+            if (cs_profile in current_settings.moduleswitches) or
+              (po_global in current_procinfo.procdef.procoptions) then
+              list.concat(Tai_symbol.createname_global(item.str,AT_FUNCTION,0))
+            else
+              list.concat(Tai_symbol.createname(item.str,AT_FUNCTION,0));
+            if tf_use_function_relative_addresses in target_info.flags then
+              list.concat(Tai_function_name.create(item.str));
+            item := tstringlistitem(item.next);
+          end;
 
         current_procinfo.procdef.procstarttai:=tai(list.last);
       end;

+ 1 - 1
compiler/systems/t_linux.pas

@@ -164,7 +164,7 @@ begin
         { the manglednames can already be the same when the procedure
           is declared with cdecl }
         pd:=tprocdef(tprocsym(hp2.sym).ProcdefList[0]);
-        if has_alias_name(pd,hp2.name^) then
+        if not has_alias_name(pd,hp2.name^) then
          begin
            { place jump in al_procedures }
            current_asmdata.asmlists[al_procedures].concat(tai_align.create(target_info.alignment.procalign));