Commit 8f89e142 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Fixed visit_function_expression error handling.

parent f449146a
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment