Jacek Caban : jscript: Introduce INVALID_LOCAL_REF.
Alexandre Julliard
julliard at winehq.org
Wed Apr 21 15:57:54 CDT 2021
Module: wine
Branch: master
Commit: 609e9de65c74233644fd6f9588122bdfc8c64d61
URL: https://source.winehq.org/git/wine.git/?a=commit;h=609e9de65c74233644fd6f9588122bdfc8c64d61
Author: Jacek Caban <jacek at codeweavers.com>
Date: Wed Apr 21 17:23:06 2021 +0200
jscript: Introduce INVALID_LOCAL_REF.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/jscript/compile.c | 1 +
dlls/jscript/engine.c | 2 +-
dlls/jscript/engine.h | 2 ++
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c
index 08a5e3af64b..717ae00d053 100644
--- a/dlls/jscript/compile.c
+++ b/dlls/jscript/compile.c
@@ -2314,6 +2314,7 @@ static HRESULT compile_function(compiler_ctx_t *ctx, source_elements_t *source,
TRACE("\n");
func->bytecode = ctx->code;
+ func->local_ref = INVALID_LOCAL_REF;
ctx->func_head = ctx->func_tail = NULL;
ctx->from_eval = from_eval;
ctx->func = func;
diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c
index f3d9d694b2a..e0a6e10e98b 100644
--- a/dlls/jscript/engine.c
+++ b/dlls/jscript/engine.c
@@ -3039,7 +3039,7 @@ static HRESULT setup_scope(script_ctx_t *ctx, call_frame_t *frame, scope_chain_t
}
for(i = 0; i < frame->function->func_cnt; i++) {
- if(frame->function->funcs[i].name && !frame->function->funcs[i].event_target) {
+ if(frame->function->funcs[i].local_ref != INVALID_LOCAL_REF) {
jsdisp_t *func_obj;
unsigned off;
diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h
index 483c32232c1..442e7334c41 100644
--- a/dlls/jscript/engine.h
+++ b/dlls/jscript/engine.h
@@ -145,6 +145,8 @@ typedef struct {
int ref;
} local_ref_t;
+#define INVALID_LOCAL_REF 0x7fffffff
+
typedef struct _function_code_t {
BSTR name;
int local_ref;
More information about the wine-cvs
mailing list