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

Blaise at blaise.ru Blaise at blaise.ru
Mon Mar 9 14:36:33 CET 2015


On 15.01.2012 18:26, Blaise Thorn wrote:

> I have implemented the support for the Delphi-compatible non-generic closures.

I am ready to commit the improved (and fully compilable) version.
Per Jonas Maebe's suggestion, I am going to create a new branch (also, last time I tried to commit into the existing "closures" branch, I was consistently getting 500 Internal Server Error).

I would like to acknowledge the participation of Craig Peterson of Scooter Software, who was persistent enough to nudge me into completing this, provided additional testing, and offered a compensation for the time spent on the last stage.


Whilst I mutilate the source code into compatibility with the FPC coding "style", I have some questions that can be raised even before the code is committed.

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?

-- 
βþ



More information about the fpc-devel mailing list