From f6b53df8040e3d127326f1c0fc47de2b481fa8fc Mon Sep 17 00:00:00 2001 From: Marko Fabo Date: Mon, 6 Nov 2017 14:15:02 +0100 Subject: [PATCH] Free `JERRY_CONTEXT (error_value)` JerryScript-DCO-1.0-Signed-off-by: Marko Fabo mfabo@inf.u-szeged.hu --- jerry-core/vm/vm.c | 1 + tests/jerry/fail/regression-test-issue-2069.js | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 tests/jerry/fail/regression-test-issue-2069.js diff --git a/jerry-core/vm/vm.c b/jerry-core/vm/vm.c index c616d31b9f..dac89ddbc0 100644 --- a/jerry-core/vm/vm.c +++ b/jerry-core/vm/vm.c @@ -146,6 +146,7 @@ vm_op_set_value (ecma_value_t object, /**< base object */ { #ifdef JERRY_ENABLE_ERROR_MESSAGES ecma_free_value (to_object); + ecma_free_value (JERRY_CONTEXT (error_value)); ecma_value_t error_value = ecma_raise_standard_error_with_format (ECMA_ERROR_TYPE, "Cannot set property '%' of %", diff --git a/tests/jerry/fail/regression-test-issue-2069.js b/tests/jerry/fail/regression-test-issue-2069.js new file mode 100644 index 0000000000..d97cba74bd --- /dev/null +++ b/tests/jerry/fail/regression-test-issue-2069.js @@ -0,0 +1,15 @@ +// Copyright JS Foundation and other contributors, http://js.foundation +// +// 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. + +null[1] = 'abcd';