* convert the array into a variant as well before calling fpc_variant_put, resolves #10495

git-svn-id: trunk@10453 -
This commit is contained in:
florian 2008-03-06 22:15:04 +00:00
parent 0ae33aeab0
commit 914a8ec4b4
3 changed files with 22 additions and 1 deletions

1
.gitattributes vendored
View File

@ -7979,6 +7979,7 @@ tests/webtbs/tw1044.pp svneol=native#text/plain
tests/webtbs/tw10454.pp svneol=native#text/plain
tests/webtbs/tw1046.pp svneol=native#text/plain
tests/webtbs/tw10489.pp svneol=native#text/plain
tests/webtbs/tw10495.pp svneol=native#text/plain
tests/webtbs/tw1050.pp svneol=native#text/plain
tests/webtbs/tw10519.pp svneol=native#text/plain
tests/webtbs/tw10540.pp svneol=native#text/plain

View File

@ -1747,7 +1747,7 @@ implementation
ccallparanode.create(caddrnode.create_internal
(ctemprefnode.create(temp)),
ccallparanode.create(ctypeconvnode.create_internal(p4,cvarianttype),
ccallparanode.create(p1
ccallparanode.create(ctypeconvnode.create_internal(p1,cvarianttype)
,nil))));
addstatement(newstatement,ccallnode.createintern('fpc_vararray_put',paras));

20
tests/webtbs/tw10495.pp Normal file
View File

@ -0,0 +1,20 @@
uses
variants;
var
tmp: OleVariant;
a: OleVariant;
b: OleVariant;
begin
tmp:=VarArrayCreate([0,2], varVariant);
a:=1234;
b:=4321;
tmp[0]:=a;
tmp[1]:=b;
a:=tmp[0];
b:=tmp[1];
if a<>1234 then
halt(1);
if b<>4321 then
halt(1);
writeln('ok');
end.