Browse Source

* check that the corresponding genericdef of the adjusted def is indeed valid

Sven/Sarah Barth 1 year ago
parent
commit
eaf24269bc
1 changed files with 6 additions and 0 deletions
  1. 6 0
      compiler/symtable.pas

+ 6 - 0
compiler/symtable.pas

@@ -3370,6 +3370,8 @@ implementation
           specialization }
         if df_specialization in symownerdef.defoptions then
           begin
+            if not assigned(symownerdef.genericdef) then
+              internalerror(2024041201);
             if not (symownerdef.genericdef.typ in [objectdef,recorddef]) then
               internalerror(2024020901);
             orgsymownerdef:=symownerdef;
@@ -3377,6 +3379,8 @@ implementation
           end;
         if assigned(contextobjdef) and (df_specialization in contextobjdef.defoptions) then
           begin
+            if not assigned(contextobjdef.genericdef) then
+              internalerror(2024041202);
             if not (contextobjdef.genericdef.typ in [objectdef,recorddef]) then
               internalerror(2024020902);
             orgcontextobjdef:=contextobjdef;
@@ -3384,6 +3388,8 @@ implementation
           end;
         if assigned(current_structdef) and (df_specialization in current_structdef.defoptions) then
           begin
+            if not assigned(current_structdef.genericdef) then
+              internalerror(2024041203);
             if not (current_structdef.genericdef.typ in [objectdef,recorddef]) then
               internalerror(2024030903);
             curstruct:=tabstractrecorddef(current_structdef.genericdef)