Просмотр исходного кода

Fix the fix for Mantis #21538. The check never really worked up to now...

defcmp.pas, compare_defs_ext:
  use "equal_defs" instead of a reference comparison to check whether the type defs are equal
pgenutil.pas, insert_generic_parameter_types:
  * add to each (specialized) generic parameter the "sp_generic_para" flag so that it will be added to the "genericparas" list upon ppu loading
  * add the generic parameter to the genericparas list as well, so that the comparison in "compare_defs_ext" is triggered at all... (up to now the list was always empty -.-)
ppu.pas:
  * increase PPU version

git-svn-id: trunk@23149 -
svenbarth 12 лет назад
Родитель
Сommit
9ef4a35a7b
3 измененных файлов с 9 добавлено и 2 удалено
  1. 6 1
      compiler/defcmp.pas
  2. 2 0
      compiler/pgenutil.pas
  3. 1 1
      compiler/ppu.pas

+ 6 - 1
compiler/defcmp.pas

@@ -206,6 +206,7 @@ implementation
          hpd : tprocdef;
          i : longint;
          diff : boolean;
+         symfrom,symto : tsym;
       begin
          eq:=te_incompatible;
          doconv:=tc_not_possible;
@@ -277,7 +278,11 @@ implementation
                begin
                  if tstoreddef(def_from).genericparas.nameofindex(i)<>tstoreddef(def_to).genericparas.nameofindex(i) then
                    internalerror(2012091302);
-                 if tstoreddef(def_from).genericparas[i]<>tstoreddef(def_to).genericparas[i] then
+                 symfrom:=ttypesym(tstoreddef(def_from).genericparas[i]);
+                 symto:=ttypesym(tstoreddef(def_to).genericparas[i]);
+                 if not (symfrom.typ=typesym) or not (symto.typ=typesym) then
+                   internalerror(2012121401);
+                 if not equal_defs(ttypesym(symfrom).typedef,ttypesym(symto).typedef) then
                    diff:=true;
                  if diff then
                    break;

+ 2 - 0
compiler/pgenutil.pas

@@ -662,6 +662,8 @@ uses
             else
               include(def.defoptions,df_specialization);
             st.insert(generictype);
+            include(generictype.symoptions,sp_generic_para);
+            def.genericparas.add(generictype.name,generictype);
           end;
        end;
 

+ 1 - 1
compiler/ppu.pas

@@ -43,7 +43,7 @@ type
 {$endif Test_Double_checksum}
 
 const
-  CurrentPPUVersion = 155;
+  CurrentPPUVersion = 156;
 
 { buffer sizes }
   maxentrysize = 1024;