diff --git a/jerry-core/vm/vm.c b/jerry-core/vm/vm.c index 695f69a14..b5a1aa5bc 100644 --- a/jerry-core/vm/vm.c +++ b/jerry-core/vm/vm.c @@ -625,11 +625,11 @@ vm_init_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */ ecma_object_t *ref_base_lex_env_p = ecma_op_resolve_reference_base (frame_ctx_p->lex_env_p, name_p); - /* TODO: check the return value */ - ecma_op_put_value_lex_env_base (ref_base_lex_env_p, - name_p, - is_strict, - lit_value); + ecma_value_t put_value_result = ecma_op_put_value_lex_env_base (ref_base_lex_env_p, + name_p, + is_strict, + lit_value); + ecma_free_value (put_value_result); } if (value_index >= register_end) diff --git a/tests/jerry/regression-test-issue-1387.js b/tests/jerry/regression-test-issue-1387.js new file mode 100644 index 000000000..8985edcad --- /dev/null +++ b/tests/jerry/regression-test-issue-1387.js @@ -0,0 +1,17 @@ +// Copyright 2016 Samsung Electronics Co., Ltd. +// Copyright 2016 University of Szeged. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict' +function undefined () {}