[fpc-devel] Closures -- debug warning @ ttgobj.FreeTemp

Hans-Peter Diettrich DrDiettrich2 at gmx.de
Tue Mar 10 13:09:20 CET 2015



Am 09.03.2015 um 14:36 schrieb Blaise at blaise.ru:
> FPC trunk r30150, compiled with EXTDEBUG, emits a debug warning for 
> the following program:
> ----------8<----------
> type T = interface
>     procedure Bar;
> end;
>
> function Foo: T;
> begin
>     result := nil
> end;
>
> begin
>     Foo().Bar()
>     // ^-- Warning: tgobj: (FreeTemp) temp at pos -44 is already free !
> end.
> ----------8<----------
> Does this indicate a problem in the compiler, or is this warning bogus?
>
I'd assume that the warning refers to "result := nil" in Foo(). Assign 
something different and try again to find out more.

DoDi



More information about the fpc-devel mailing list