Fix redeclaration related eval corner cases (#4886)

- Fix cases where a function parameter binding is redeclared inside a parameter initializer eval
- Fix cases where a let- or function arguments binding is redeclared inside a function block because
  there is a declaration in a function parameter initializer eval
- Also remove the ECMA_PARSE_CHAIN_INDEX_SHIFT macro, added a debugger_eval_chain_index named field to the jerry context instead

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
This commit is contained in:
Szilagyi Adam
2021-12-15 12:45:10 +01:00
committed by GitHub
parent 768a209544
commit d650390e47
8 changed files with 158 additions and 191 deletions
+2 -2
View File
@@ -315,8 +315,8 @@ vm_run_eval (ecma_compiled_code_t *bytecode_data_p, /**< byte-code data */
lex_env_p = JERRY_CONTEXT (vm_top_context_p)->lex_env_p;
#if JERRY_DEBUGGER
uint32_t chain_index = parse_opts >> ECMA_PARSE_CHAIN_INDEX_SHIFT;
parse_opts &= (1 << ECMA_PARSE_CHAIN_INDEX_SHIFT) - 1;
uint32_t chain_index = JERRY_CONTEXT (debugger_eval_chain_index);
JERRY_CONTEXT (debugger_eval_chain_index) = 0;
while (chain_index != 0)
{