Browse Source

* also pass in the symbol parsed on the right side of "as" and "is" to generate_inline_specialization() which means that gensym can now be considered non-Nil

Sven/Sarah Barth 1 month ago
parent
commit
e23c96dae2
1 changed files with 5 additions and 2 deletions
  1. 5 2
      compiler/pexpr.pas

+ 5 - 2
compiler/pexpr.pas

@@ -4510,6 +4510,9 @@ implementation
           inheriteddef : tabstractrecorddef;
           inheriteddef : tabstractrecorddef;
           callflags : tcallnodeflags;
           callflags : tcallnodeflags;
         begin
         begin
+          if not assigned(gensym) then
+            internalerror(2025103101);
+
           if n.nodetype=specializen then
           if n.nodetype=specializen then
             begin
             begin
               getaddr:=tspecializenode(n).getaddr;
               getaddr:=tspecializenode(n).getaddr;
@@ -4529,7 +4532,7 @@ implementation
           if assigned(parseddef) and assigned(gensym) and assigned(p2) then
           if assigned(parseddef) and assigned(gensym) and assigned(p2) then
             gendef:=generate_specialization_phase1(spezcontext,gendef,unitspecific,parseddef,gensym.realname,gensym.owner,p2.fileinfo)
             gendef:=generate_specialization_phase1(spezcontext,gendef,unitspecific,parseddef,gensym.realname,gensym.owner,p2.fileinfo)
           else
           else
-            gendef:=generate_specialization_phase1(spezcontext,gendef,unitspecific);
+            gendef:=generate_specialization_phase1(spezcontext,gendef,unitspecific,gensym.realname,gensym.owner);
           case gendef.typ of
           case gendef.typ of
             errordef:
             errordef:
               begin
               begin
@@ -4860,7 +4863,7 @@ implementation
                          else
                          else
                            internalerror(2015072401);
                            internalerror(2015072401);
 
 
-                       ptmp:=generate_inline_specialization(gendef,p2,filepos,nil,nil,nil);
+                       ptmp:=generate_inline_specialization(gendef,p2,filepos,nil,gensym,nil);
 
 
                        { we don't need the old p2 anymore }
                        { we don't need the old p2 anymore }
                        p2.Free;
                        p2.Free;