[Bug 53867] New: vbscript fails to retrieve property array by index
https://bugs.winehq.org/show_bug.cgi?id=53867 Bug ID: 53867 Summary: vbscript fails to retrieve property array by index Product: Wine Version: 7.20 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: vbscript Assignee: wine-bugs(a)winehq.org Reporter: jsm174(a)gmail.com Distribution: --- Given the following vbscript, access to aObj.ModIn(x) and aObj.ModOut(x) fail: dim RubbersD : Set RubbersD = new Dampener RubbersD.addpoint 0, 0, 1.1 RubbersD.addpoint 1, 3.77, 0.97 RubbersD.addpoint 2, 5.76, 0.967 RubbersD.addpoint 3, 15.84, 0.874 RubbersD.addpoint 4, 56, 0.64 dim SleevesD : Set SleevesD = new Dampener SleevesD.CopyCoef RubbersD, 0.85 Class Dampener Public ModIn, ModOut Private Sub Class_Initialize : redim ModIn(5) : redim Modout(5): End Sub Public Sub AddPoint(aIdx, aX, aY) ModIn(aIdx) = aX ModOut(aIdx) = aY End Sub Public Sub CopyCoef(aObj, aCoef) dim x : for x = 0 to uBound(aObj.ModIn) addpoint x, aObj.ModIn(x), aObj.ModOut(x)*aCoef Next End Sub End Class It seems invoke_variant_prop in vbdisp.c has specific code that looks to see if there is an argument, and if so fails. I've added a block that only fails if there are arguments and the variant is not an ARRAY. I lifted the code from array_access in interp.c. Unfortunately array_access is not available to vbdisp.c: static HRESULT invoke_variant_prop(script_ctx_t *ctx, VARIANT *v, WORD flags, DISPPARAMS *dp, VARIANT *res) { HRESULT hres; switch(flags) { case DISPATCH_PROPERTYGET|DISPATCH_METHOD: case DISPATCH_PROPERTYGET: if(dp->cArgs) { if (V_ISARRAY(v)) { SAFEARRAY *array = V_ARRAY(v); unsigned i, argc = arg_cnt(dp); LONG *indices; if(!array) { FIXME("NULL array\n"); return E_FAIL; } . . . else { WARN("called with arguments\n"); return DISP_E_MEMBERNOTFOUND; /* That's what tests show */ } -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=53867 --- Comment #1 from Nikolay Sivov <bunglehead(a)gmail.com> --- This looks reasonable, I think, if arguments for such properties can only mean array indices. I suppose V_ISARRAY() check ensures that. Note that it's not a problem to reuse array_access(), no benefit in duplicating it. Execution context is not used in this helper, we can get rid of it there. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=53867 Nikolay Sivov <bunglehead(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW --- Comment #2 from Nikolay Sivov <bunglehead(a)gmail.com> --- Confirming, just sent a fix https://gitlab.winehq.org/wine/wine/-/merge_requests/1409. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=53867 --- Comment #3 from Jason Millard <jsm174(a)gmail.com> --- Fantastic. Implemented your patch and working great! Thanks again! -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=53867 --- Comment #4 from Nikolay Sivov <bunglehead(a)gmail.com> --- We'll need symmetrical change at some point to write to such properties, I haven't looked at that. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=53867 Nikolay Sivov <bunglehead(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |eeecf6f034ff72cb3ba3285227b | |eb70bd9b82a37 Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #5 from Nikolay Sivov <bunglehead(a)gmail.com> --- Marking fixed, eeecf6f034ff72cb3ba3285227beb70bd9b82a37. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=53867 --- Comment #6 from Jason Millard <jsm174(a)gmail.com> --- (In reply to Nikolay Sivov from comment #4)
We'll need symmetrical change at some point to write to such properties, I haven't looked at that.
Okay. Is that at all related to https://bugs.winehq.org/show_bug.cgi?id=53877 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=53867 --- Comment #7 from Nikolay Sivov <bunglehead(a)gmail.com> --- No, I was talking about assigning values to properties. Like in your sample script doing aObj.ModIn(x) = value. That will go through PROPERTYPUT. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=53867 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #8 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 7.22. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=53867 Michael Stefaniuc <mstefani(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |7.0.x -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=53867 Michael Stefaniuc <mstefani(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|7.0.x |--- --- Comment #9 from Michael Stefaniuc <mstefani(a)winehq.org> --- Drop 7.0.x target milestone from bugs that didn't make it. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla