Gabriel Ivăncescu : jscript: Access the PROTREF with proper index instead of get_prop.

Alexandre Julliard julliard at winehq.org
Wed Nov 24 15:17:18 CST 2021


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

Author: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Date:   Wed Nov 24 16:10:36 2021 +0200

jscript: Access the PROTREF with proper index instead of get_prop.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
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, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c
index eba3b738b12..a00e36b9654 100644
--- a/dlls/jscript/dispex.c
+++ b/dlls/jscript/dispex.c
@@ -109,8 +109,12 @@ static inline BOOL is_function_prop(dispex_prop_t *prop)
 static DWORD get_flags(jsdisp_t *This, dispex_prop_t *prop)
 {
     if(prop->type == PROP_PROTREF) {
-        dispex_prop_t *parent = get_prop(This->prototype, prop->u.ref);
-        if(!parent) {
+        dispex_prop_t *parent = NULL;
+
+        if(prop->u.ref < This->prototype->prop_cnt)
+            parent = &This->prototype->props[prop->u.ref];
+
+        if(!parent || parent->type == PROP_DELETED) {
             prop->type = PROP_DELETED;
             return 0;
         }




More information about the wine-cvs mailing list