* all types with inittable need a persistant temp

git-svn-id: trunk@1472 -
This commit is contained in:
peter 2005-10-18 12:29:04 +00:00
parent adfd36d189
commit 0981495c7b
3 changed files with 33 additions and 17 deletions

1
.gitattributes vendored
View File

@ -6289,6 +6289,7 @@ tests/webtbs/tw4089.pp svneol=native#text/plain
tests/webtbs/tw4093.pp svneol=native#text/plain
tests/webtbs/tw4098.pp svneol=native#text/plain
tests/webtbs/tw4100.pp svneol=native#text/plain
tests/webtbs/tw4104.pp svneol=native#text/plain
tests/webtbs/tw4115.pp svneol=native#text/plain
tests/webtbs/tw4119.pp svneol=native#text/plain
tests/webtbs/tw4140.pp svneol=native#text/plain

View File

@ -850,24 +850,10 @@ implementation
end
else
if is_ansistring(lt) then
{$ifdef ansistring_bits}
begin
case Tstringdef(lt).string_typ of
st_ansistring16:
vtype:=vtAnsiString16;
st_ansistring32:
vtype:=vtAnsiString32;
st_ansistring64:
vtype:=vtAnsiString64;
end;
freetemp:=false;
end
{$else}
begin
vtype:=vtAnsiString;
freetemp:=false;
end
{$endif}
else
if is_widestring(lt) then
begin
@ -898,9 +884,7 @@ implementation
else
{ normal array constructor of the same type }
begin
if (is_ansistring(left.resulttype.def) or
is_widestring(left.resulttype.def) or
(left.resulttype.def.deftype=variantdef)) then
if resulttype.def.needs_inittable then
freetemp:=false;
case hp.left.location.loc of
LOC_FPUREGISTER,

31
tests/webtbs/tw4104.pp Executable file
View File

@ -0,0 +1,31 @@
{ Source provided for Free Pascal Bug Report 4104 }
{ Submitted by "Daniël Mantione" on 2005-06-22 }
{ e-mail: daniel@freepascal.org }
program bug;
type junk=record
data:ansistring;
end;
operator :=(x:longint) result:junk;
begin
str(x,result.data);
end;
procedure write_junk(const data:array of junk);
var i:cardinal;
begin
for i:=low(data) to high(data) do
begin
write(data[i].data);
write('<-->');
writeln(Pchar(data[i].data));
end;
end;
begin
write_junk([1,2]);
end.