From 914a8ec4b4ffed99e17a2434dd8aabd24db5fee0 Mon Sep 17 00:00:00 2001 From: florian Date: Thu, 6 Mar 2008 22:15:04 +0000 Subject: [PATCH] * convert the array into a variant as well before calling fpc_variant_put, resolves #10495 git-svn-id: trunk@10453 - --- .gitattributes | 1 + compiler/pexpr.pas | 2 +- tests/webtbs/tw10495.pp | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 tests/webtbs/tw10495.pp diff --git a/.gitattributes b/.gitattributes index 5df0b49108..7b905067ed 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/compiler/pexpr.pas b/compiler/pexpr.pas index 1916ecb87f..7182b96334 100644 --- a/compiler/pexpr.pas +++ b/compiler/pexpr.pas @@ -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)); diff --git a/tests/webtbs/tw10495.pp b/tests/webtbs/tw10495.pp new file mode 100644 index 0000000000..d71554be40 --- /dev/null +++ b/tests/webtbs/tw10495.pp @@ -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.