Skip to content

Commit 348e9ed

Browse files
bugfix if only VT_ARRAY is passed
1 parent bc6f270 commit 348e9ed

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ext/com_dotnet/com_variant.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -552,14 +552,15 @@ PHP_METHOD(variant, __construct)
552552
/**
553553
* VT_ARRAY functionality
554554
*
555-
* If already an array and VT_ARRAY is passed then:
556-
* - if only VT_ARRAY passed then do not perform a conversion
557-
* - if VT_ARRAY plus other type passed then perform conversion
555+
* If already an array and VT_ARRAY is passed then perform conversion
558556
*/
559557

560558
res = S_OK;
561559
SAFEARRAYBOUND Bound;
562560

561+
if(vt == VT_ARRAY) //By default VT_ARRAY is VT_ARRAY | VT_VARIANT
562+
vt |= VT_VARIANT;
563+
563564
if ((vt & ~VT_ARRAY) && //new variant have some type except VT_ARRAY
564565
(V_VT(&obj->v) & VT_ARRAY) && //our variant is array
565566
SafeArrayGetDim(V_ARRAY(&obj->v)) == 1 && //our array have one dimension

0 commit comments

Comments
 (0)