Commit 708c83e2 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Make 0 an invalid code offset.

parent 11453b24
...@@ -2614,7 +2614,7 @@ HRESULT exec_source(exec_ctx_t *ctx, parser_ctx_t *parser, source_elements_t *so ...@@ -2614,7 +2614,7 @@ HRESULT exec_source(exec_ctx_t *ctx, parser_ctx_t *parser, source_elements_t *so
ctx->parser = parser; ctx->parser = parser;
if(source->statement) { if(source->statement) {
if(source->instr_off == -1) { if(!source->instr_off) {
hres = compile_subscript_stat(ctx->parser, source->statement, from_eval, &source->instr_off); hres = compile_subscript_stat(ctx->parser, source->statement, from_eval, &source->instr_off);
if(FAILED(hres) && is_jscript_error(hres)) if(FAILED(hres) && is_jscript_error(hres))
hres = throw_syntax_error(script, ei, hres, NULL); hres = throw_syntax_error(script, ei, hres, NULL);
......
...@@ -1342,7 +1342,7 @@ static void *new_expression(parser_ctx_t *ctx, expression_type_t type, size_t si ...@@ -1342,7 +1342,7 @@ static void *new_expression(parser_ctx_t *ctx, expression_type_t type, size_t si
expression_t *ret = parser_alloc(ctx, size ? size : sizeof(*ret)); expression_t *ret = parser_alloc(ctx, size ? size : sizeof(*ret));
ret->type = type; ret->type = type;
ret->instr_off = -1; ret->instr_off = 0;
return ret; return ret;
} }
...@@ -1470,7 +1470,7 @@ static source_elements_t *new_source_elements(parser_ctx_t *ctx) ...@@ -1470,7 +1470,7 @@ static source_elements_t *new_source_elements(parser_ctx_t *ctx)
source_elements_t *ret = parser_alloc(ctx, sizeof(source_elements_t)); source_elements_t *ret = parser_alloc(ctx, sizeof(source_elements_t));
memset(ret, 0, sizeof(*ret)); memset(ret, 0, sizeof(*ret));
ret->instr_off = -1; ret->instr_off = 0;
return ret; return ret;
} }
......
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