Recent

Author Topic: Internal error 2011061401  (Read 179 times)

Fibonacci

  • Hero Member
  • *****
  • Posts: 577
  • Internal Error Hunter
Internal error 2011061401
« on: October 30, 2024, 08:26:08 pm »
Code: Pascal  [Select][+][-]
  1. program ie2011061401;
  2.  
  3. type
  4.   tt = type TInterfacedObject; // project1.lpr(4,30) Error: Internal error 2011061401
  5.  
  6. begin
  7. end.

Reported to: https://gitlab.com/freepascal.org/fpc/source/-/issues/40982

Here it is in the compiler source: compiler/symdef.pas:9156

Code: Pascal  [Select][+][-]
  1.     function TImplementedInterface.getcopy:TImplementedInterface;
  2.       begin
  3.         Result:=TImplementedInterface.Create(nil);
  4.         { 1) the procdefs list will be freed once for each copy
  5.           2) since the procdefs list owns its elements, those will also be freed for each copy
  6.           3) idem for the name mappings
  7.         }
  8.         { warning: this is completely wrong on so many levels...
  9.         Move(pointer(self)^,pointer(result)^,InstanceSize);
  10.         We need to make clean copies of the different fields
  11.         this is not implemented yet, and thus we generate an internal
  12.         error instead PM 2011-06-14 }
  13.         internalerror(2011061401);
  14.       end;
  15.  

Thaddy

  • Hero Member
  • *****
  • Posts: 15992
  • Censorship about opinions does not belong here.
Re: Internal error 2011061401
« Reply #1 on: October 30, 2024, 08:40:14 pm »
I can confirm this. It goes wrong with the interface support.
If I smell bad code it usually is bad code and that includes my own code.

 

TinyPortal © 2005-2018