Jacek Caban : jscript: Use internal jsdisp calls only within the same script context.

Alexandre Julliard julliard at winehq.org
Thu Jan 30 16:10:23 CST 2020


Module: wine
Branch: master
Commit: 614ea7e6243ead003bcfe4624895154972f3445f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=614ea7e6243ead003bcfe4624895154972f3445f

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Jan 30 15:49:53 2020 +0100

jscript: Use internal jsdisp calls only within the same script context.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/jscript/dispex.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c
index 6f9a0eb7f3..cd610e4e88 100644
--- a/dlls/jscript/dispex.c
+++ b/dlls/jscript/dispex.c
@@ -1951,7 +1951,7 @@ HRESULT disp_call(script_ctx_t *ctx, IDispatch *disp, DISPID id, WORD flags, uns
     HRESULT hres;
 
     jsdisp = iface_to_jsdisp(disp);
-    if(jsdisp) {
+    if(jsdisp && jsdisp->ctx == ctx) {
         if(flags & DISPATCH_PROPERTYPUT) {
             FIXME("disp_call(propput) on builtin object\n");
             return E_FAIL;
@@ -2046,7 +2046,7 @@ HRESULT disp_call_value(script_ctx_t *ctx, IDispatch *disp, IDispatch *jsthis, W
     assert(!(flags & ~(DISPATCH_METHOD|DISPATCH_CONSTRUCT|DISPATCH_JSCRIPT_INTERNAL_MASK)));
 
     jsdisp = iface_to_jsdisp(disp);
-    if(jsdisp) {
+    if(jsdisp && jsdisp->ctx == ctx) {
         if(ctx != jsdisp->ctx)
             flags &= ~DISPATCH_JSCRIPT_INTERNAL_MASK;
         hres = jsdisp_call_value(jsdisp, jsthis, flags, argc, argv, r);
@@ -2170,7 +2170,7 @@ HRESULT disp_propput(script_ctx_t *ctx, IDispatch *disp, DISPID id, jsval_t val)
     HRESULT hres;
 
     jsdisp = iface_to_jsdisp(disp);
-    if(jsdisp) {
+    if(jsdisp && jsdisp->ctx == ctx) {
         dispex_prop_t *prop;
 
         prop = get_prop(jsdisp, id);
@@ -2272,7 +2272,7 @@ HRESULT disp_propget(script_ctx_t *ctx, IDispatch *disp, DISPID id, jsval_t *val
     HRESULT hres;
 
     jsdisp = iface_to_jsdisp(disp);
-    if(jsdisp) {
+    if(jsdisp && jsdisp->ctx == ctx) {
         hres = jsdisp_propget(jsdisp, id, val);
         jsdisp_release(jsdisp);
         return hres;




More information about the wine-cvs mailing list