* prevent double freeing temps containing int64-sized parameters

(mantis #19700)

git-svn-id: trunk@18053 -
This commit is contained in:
Jonas Maebe 2011-08-01 17:12:45 +00:00
parent e7b85a6175
commit da3fb5de0f
3 changed files with 32 additions and 1 deletions

1
.gitattributes vendored
View File

@ -11695,6 +11695,7 @@ tests/webtbs/tw1948.pp svneol=native#text/plain
tests/webtbs/tw1950.pp svneol=native#text/plain
tests/webtbs/tw19548.pp svneol=native#text/pascal
tests/webtbs/tw1964.pp svneol=native#text/plain
tests/webtbs/tw19700.pp svneol=native#text/plain
tests/webtbs/tw1996.pp svneol=native#text/plain
tests/webtbs/tw2001.pp svneol=native#text/plain
tests/webtbs/tw2002.pp svneol=native#text/plain

View File

@ -1037,7 +1037,11 @@ implementation
tmploc:=l;
location_force_mem(list,tmploc);
cg.a_load_loc_cgpara(list,tmploc,cgpara);
location_freetemp(list,tmploc);
{ do not free the tmploc in case the original value was
already in memory, because the caller (ncgcal) will then
free it again later }
if not(l.loc in [LOC_REFERENCE,LOC_CREFERENCE]) then
location_freetemp(list,tmploc);
end
else
{$endif not cpu64bitalu}

26
tests/webtbs/tw19700.pp Normal file
View File

@ -0,0 +1,26 @@
{ %target=darwin }
{ %norun }
{$mode objfpc}
{$modeswitch objectivec1}
program Main;
uses
CocoaAll;
type
TSomeView = objcclass (NSView)
function canvasPointFromEvent (theEvent: NSEvent): NSPoint; message 'canvasPointFromEvent:';
end;
function TSomeView.canvasPointFromEvent (theEvent: NSEvent): NSPoint;
begin
result := convertPoint_fromView(theEvent.locationInWindow, nil);
end;
var
argc: LongInt;
argv: PPChar;
begin
NSApplicationMain(argc, argv);
end.