jscript: Introduce INVALID_LOCAL_REF.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2021-04-21 17:23:06 +02:00 committed by Alexandre Julliard
parent 7ba144b469
commit 609e9de65c
3 changed files with 4 additions and 1 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;