Skip to content

Commit 788fdc6

Browse files
rerobikadbatyai
authored andcommitted
Add missing release value call to %TypedArray%.prototype.findIndex routine (#2958)
This patch fixes #2947 Co-authored-by: Gabor Loki loki@inf.u-szeged.hu JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
1 parent 1374d5f commit 788fdc6

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-typedarray-prototype.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1550,7 +1550,13 @@ ecma_builtin_typedarray_prototype_find_helper (ecma_value_t this_arg, /**< this
15501550

15511551
if (call_result)
15521552
{
1553-
return is_find ? element_value : ecma_make_uint32_value (buffer_index);
1553+
if (is_find)
1554+
{
1555+
return element_value;
1556+
}
1557+
1558+
ecma_free_value (element_value);
1559+
return ecma_make_uint32_value (buffer_index);
15541560
}
15551561
buffer_index++;
15561562
ecma_free_value (element_value);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright JS Foundation and other contributors, http://js.foundation
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
assert(new Uint32Array(Array(undefined, 9040650076)).findIndex(function (p_0) { return p_0 }) === 1);

0 commit comments

Comments
 (0)