瀏覽代碼

* keep track of the current generic def in the specialization state

Sven/Sarah Barth 7 月之前
父節點
當前提交
8f81b213dc
共有 2 個文件被更改,包括 6 次插入4 次删除
  1. 5 4
      compiler/pgentype.pas
  2. 1 0
      compiler/pgenutil.pas

+ 5 - 4
compiler/pgentype.pas

@@ -36,10 +36,11 @@ const
 type
   pspecializationstate = ^tspecializationstate;
   tspecializationstate = record
-    oldsymtablestack    : tsymtablestack;
-    oldextendeddefs     : tfphashobjectlist;
-    oldgenericdummysyms : tfphashobjectlist;
-    oldspecializestate  : pspecializationstate;
+    oldsymtablestack      : tsymtablestack;
+    oldextendeddefs       : tfphashobjectlist;
+    oldgenericdummysyms   : tfphashobjectlist;
+    oldspecializestate    : pspecializationstate;
+    oldcurrent_genericdef : tdef;
   end;
 
   tspecializationcontext=class

+ 1 - 0
compiler/pgenutil.pas

@@ -2740,6 +2740,7 @@ uses
       state.oldsymtablestack:=symtablestack;
       state.oldextendeddefs:=current_module.extendeddefs;
       state.oldgenericdummysyms:=current_module.genericdummysyms;
+      state.oldcurrent_genericdef:=current_genericdef;
       state.oldspecializestate:=pspecializationstate(current_module.specializestate);
       current_module.specializestate:=@state;
       current_module.extendeddefs:=TFPHashObjectList.create(true);