Browse Source

* fix the internal error of #40639; however as the test code in question will only compile correctly with the next commit no test is added yet

Sven/Sarah Barth 1 year ago
parent
commit
5e05630713
1 changed files with 4 additions and 3 deletions
  1. 4 3
      compiler/pdecobj.pas

+ 4 - 3
compiler/pdecobj.pas

@@ -774,6 +774,9 @@ implementation
           Internalerror(2011021103);
 
         consume(_FOR);
+        { set extendeddef to non-Nil so that potential checks for it won't trigger
+          access violations }
+        current_objectdef.extendeddef:=generrordef;
         single_type(hdef,[stoParseClassParent]);
         if not assigned(hdef) or (hdef.typ=errordef) then
           begin
@@ -837,9 +840,7 @@ implementation
           end;
 
         if assigned(hdef) then
-          current_objectdef.extendeddef:=hdef
-        else
-          current_objectdef.extendeddef:=generrordef;
+          current_objectdef.extendeddef:=hdef;
       end;
 
     procedure parse_guid;