Skip to content

Commit

Permalink
[Weex][Core] bugfix try catch exception must clean the context error …
Browse files Browse the repository at this point in the history
…value
  • Loading branch information
pengtaopt committed Jan 9, 2019
1 parent f7e5c57 commit d185614
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion weex_core/Source/qking/core/vm/qking_vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1827,7 +1827,8 @@ static ecma_value_t vm_run_loop(
QKING_ASSERT(GET_OP_CODE(pc[-1]) == OP_CATCH);
ecma_register_t *register_error = registers_p + (uint32_t)(GET_ARG_A(pc[-1]));
ecma_fast_free_value(register_error->var);
register_error->var = ecma_copy_value(QKING_CONTEXT(error_value));
register_error->var = QKING_CONTEXT(error_value);
QKING_CONTEXT(error_value) = ECMA_VALUE_UNDEFINED;
ecma_object_t *catch_env_p = ecma_create_decl_lex_env(frame_ctx_p->lex_env_p);
frame_ctx_p->lex_env_p = catch_env_p;
} else {
Expand Down
1 change: 1 addition & 0 deletions weex_core/Source/qking/core/vm/vm_exec_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ bool qking_vm_exec_state_execute(qking_vm_exec_state_t *exec_state_p, ecma_value
QKING_TO_LOG_STR_FINISH(err_str);
qking_release_value(err_ret_value);
} else {
// todo process context error value
ecma_free_value(QKING_CONTEXT (error_value));
QKING_CONTEXT (error_value) = ECMA_VALUE_UNDEFINED;
if (err_value) {
Expand Down

0 comments on commit d185614

Please sign in to comment.