diff --git a/jerry-core/parser/js/js-parser.c b/jerry-core/parser/js/js-parser.c index aed711d1c3..bdda834b0c 100644 --- a/jerry-core/parser/js/js-parser.c +++ b/jerry-core/parser/js/js-parser.c @@ -1228,10 +1228,6 @@ parse_print_final_cbc (ecma_compiled_code_t *compiled_code_p, /**< compiled code } byte_code_start_p += (unsigned int) (literal_end - register_end) * sizeof (ecma_value_t); - if (JERRY_UNLIKELY (compiled_code_p->status_flags & CBC_CODE_FLAGS_NON_STRICT_ARGUMENTS_NEEDED)) - { - byte_code_start_p += argument_end * sizeof (ecma_value_t); - } byte_code_end_p = byte_code_start_p + length; byte_code_p = byte_code_start_p; diff --git a/tests/jerry/regression-test-issue-2400.js b/tests/jerry/regression-test-issue-2400.js new file mode 100644 index 0000000000..f6b40053fc --- /dev/null +++ b/tests/jerry/regression-test-issue-2400.js @@ -0,0 +1,22 @@ +// 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. + +// Wrong byte codes were dumped for this function when show opcodes had been enabled + +function abc(a,b) { + var c = 6; + return arguments[0] + b + c; +} + +abc(1, 2);