jscript: Fixed visit_function_expression error handling.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2017-10-09 14:35:48 +02:00 committed by Alexandre Julliard
parent f449146ae3
commit 8f89e142ec
1 changed files with 4 additions and 3 deletions

View File

@ -1874,12 +1874,13 @@ static BOOL alloc_variable(compiler_ctx_t *ctx, const WCHAR *name)
return alloc_local(ctx, ident, ctx->func->var_cnt++);
}
static BOOL visit_function_expression(compiler_ctx_t *ctx, function_expression_t *expr)
static HRESULT visit_function_expression(compiler_ctx_t *ctx, function_expression_t *expr)
{
expr->func_id = ctx->func->func_cnt++;
ctx->func_tail = ctx->func_tail ? (ctx->func_tail->next = expr) : (ctx->func_head = expr);
return !expr->identifier || expr->event_target || alloc_variable(ctx, expr->identifier);
return !expr->identifier || expr->event_target || alloc_variable(ctx, expr->identifier)
? S_OK : E_OUTOFMEMORY;
}
static HRESULT visit_expression(compiler_ctx_t *ctx, expression_t *expr)
@ -1992,7 +1993,7 @@ static HRESULT visit_expression(compiler_ctx_t *ctx, expression_t *expr)
break;
}
case EXPR_FUNC:
visit_function_expression(ctx, (function_expression_t*)expr);
hres = visit_function_expression(ctx, (function_expression_t*)expr);
break;
case EXPR_MEMBER:
hres = visit_expression(ctx, ((member_expression_t*)expr)->expression);