* memory leaks for ansistring type casts fixed

This commit is contained in:
florian 1998-12-22 13:10:56 +00:00
parent da168cb97f
commit 802fd8fb5c
3 changed files with 32 additions and 20 deletions

View File

@ -1156,16 +1156,17 @@ implementation
if p^.treetype=muln then
begin
if cs_check_overflow in aktlocalswitches then
push_int(1)
else
push_int(0);
release_qword_loc(p^.left^.location);
release_qword_loc(p^.right^.location);
p^.location.registerlow:=getexplicitregister32(R_EAX);
p^.location.registerhigh:=getexplicitregister32(R_EDX);
{ ($80 shr byte(r) }
pushusedregisters(pushedreg,$ff);
pushusedregisters(pushedreg,$ff
and not($80 shr byte(p^.location.registerlow))
and not($80 shr byte(p^.location.registerhigh)));
if cs_check_overflow in aktlocalswitches then
push_int(1)
else
push_int(0);
emit_pushq_loc(p^.left^.location);
emit_pushq_loc(p^.right^.location);
if porddef(p^.resulttype)^.typ=u64bit then
@ -1733,7 +1734,10 @@ implementation
end.
{
$Log$
Revision 1.36 1998-12-19 00:23:40 florian
Revision 1.37 1998-12-22 13:10:56 florian
* memory leaks for ansistring type casts fixed
Revision 1.36 1998/12/19 00:23:40 florian
* ansistring memory leaks fixed
Revision 1.35 1998/12/11 23:36:06 florian

View File

@ -1489,7 +1489,7 @@ implementation
if not (cs_compilesystem in aktmoduleswitches) then
concat_external('FPC_WIDESTR_DECR_REF',EXT_NEAR);
end;
ungetiftemp(hr);
popusedregisters(pushedregs);
end
else
@ -1665,7 +1665,10 @@ implementation
end.
{
$Log$
Revision 1.54 1998-12-19 00:23:41 florian
Revision 1.55 1998-12-22 13:10:58 florian
* memory leaks for ansistring type casts fixed
Revision 1.54 1998/12/19 00:23:41 florian
* ansistring memory leaks fixed
Revision 1.53 1998/12/11 00:02:47 peter

View File

@ -477,7 +477,6 @@ implementation
var
ltemptoremove : plinkedlist;
destroys : boolean;
procedure second_string_to_string(pto,pfrom : ptree;convtyp : tconverttype);
@ -509,8 +508,10 @@ implementation
begin
gettempofsizereference(pto^.resulttype^.size,pto^.location.reference);
loadansi2short(pfrom,pto);
{ this is done in secondtypeconv (FK)
removetemps(exprasmlist,temptoremove);
destroys:=true;
}
end;
st_widestring:
begin
@ -546,7 +547,7 @@ implementation
pto^.location.loc:=LOC_REFERENCE;
clear_reference(pto^.location.reference);
gettempofsizereference(pto^.resulttype^.size,pto^.location.reference);
temptoremove^.concat(new(ptemptodestroy,init(pto^.location.reference,pto^.resulttype)));
ltemptoremove^.concat(new(ptemptodestroy,init(pto^.location.reference,pto^.resulttype)));
exprasmlist^.concat(new(pai386,op_const_ref(A_MOV,S_L,0,newreference(pto^.location.reference))));
pushusedregisters(pushed,$ff);
emit_push_lea_loc(pfrom^.location);
@ -746,7 +747,7 @@ implementation
st_ansistring :
begin
gettempofsizereference(4,pto^.location.reference);
temptoremove^.concat(new(ptemptodestroy,init(pto^.location.reference,pto^.resulttype)));
ltemptoremove^.concat(new(ptemptodestroy,init(pto^.location.reference,pto^.resulttype)));
exprasmlist^.concat(new(pai386,op_const_ref(A_MOV,S_L,0,newreference(pto^.location.reference))));
pushusedregisters(pushed,$ff);
emit_pushw_loc(pfrom^.location);
@ -1235,6 +1236,8 @@ implementation
begin
stringdispose(pto^.location.reference.symbol);
gettempofsizereference(pto^.resulttype^.size,pto^.location.reference);
ltemptoremove^.concat(new(ptemptodestroy,init(pto^.location.reference,pto^.resulttype)));
exprasmlist^.concat(new(pai386,op_const_ref(A_MOV,S_L,0,newreference(pto^.location.reference))));
case pfrom^.location.loc of
LOC_REGISTER,LOC_CREGISTER:
begin
@ -1336,10 +1339,12 @@ implementation
begin
{ the ansi string disposing is a little bit hairy: }
destroys:=false;
oldrl:=temptoremove;
temptoremove:=new(plinkedlist,init);
{ the helper routines need access to the release list }
ltemptoremove:=oldrl;
{ this isn't good coding, I think tc_bool_2_int, shouldn't be }
{ type conversion (FK) }
@ -1352,14 +1357,11 @@ implementation
if codegenerror then
exit;
end;
{ the helper routines need access to the release list }
ltemptoremove:=temptoremove;
{the second argument only is for maybe_range_checking !}
{ the second argument only is for maybe_range_checking !}
secondconvert[p^.convtyp](p,p^.left,p^.convtyp);
{ are the temp. ansistrings been destroyed ? }
if not destroys then
oldrl^.concatlist(temptoremove);
{ clean up all temp. objects (ansi/widestrings) }
removetemps(exprasmlist,temptoremove);
dispose(temptoremove,done);
temptoremove:=oldrl;
end;
@ -1474,7 +1476,10 @@ implementation
end.
{
$Log$
Revision 1.42 1998-12-19 00:23:42 florian
Revision 1.43 1998-12-22 13:10:59 florian
* memory leaks for ansistring type casts fixed
Revision 1.42 1998/12/19 00:23:42 florian
* ansistring memory leaks fixed
Revision 1.41 1998/11/30 19:48:54 peter