Jacek Caban (@jacek) commented about dlls/vbscript/interp.c:
+ if(!val.owned) { + V_VT(&v) = VT_EMPTY; + hres = VariantCopy(&v, val.v); + if(FAILED(hres)) + return hres; + r = &v; + } + + if (V_VT(r) == VT_BSTR) { + hastocoerce = TRUE; + V_VT(&vcoerced) = VT_EMPTY; + hres = VariantChangeType(&vcoerced, r, 0, VT_R8); + if(FAILED(hres)) + return hres; + } + return stack_push(ctx, hastocoerce? &vcoerced : r); This looks correct now, but you could avoid extra copy and simplify things a bit if you handled VT_BSTR first, separately. You could move `VT_BSTR` check earlier, pass `val.v` as `VariantChangeType` source, call `release_val` and return early with `stack_push`. The rest of the function could then look just like `interp_val`.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/4615#note_55385