https://bugs.winehq.org/show_bug.cgi?id=53844
Bug ID: 53844 Summary: vbscript invoke_vbdisp not handling let property correctly for VT_DISPATCH arguments Product: Wine Version: 7.19 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: vbscript Assignee: wine-bugs@winehq.org Reporter: jsm174@gmail.com Distribution: ---
Given the following code where 'LeftFlipper' is Dispatch object:
dim LF : Set LF = New FlipperPolarity LF.Object = LeftFlipper
Class FlipperPolarity private Flipper
Public Sub Class_Initialize End Sub
Public Property let Object(aInput) : Set Flipper = aInput : End Property End Class
In invoke_vbdisp, the Object property is stored in This->desc->funcs[id].entries[VBDISP_LET]
The code tries to find the function using the VBDISP_SET index since the argument is VT_DISPATCH:
func = This->desc->funcs[id].entries[V_VT(dp.rgvarg) == VT_DISPATCH ? VBDISP_SET : VBDISP_LET];
At first I tried to reverse the order figuring maybe this was a typo, however then it broke let's with non-objects.
So as a hack I did this:
func = This->desc->funcs[id].entries[V_VT(dp.rgvarg) == VT_DISPATCH ? VBDISP_SET : VBDISP_LET]; if(!func) func = This->desc->funcs[id].entries[VBDISP_LET]; if(!func) { FIXME("no letter/setter\n");