Skip to content

Commit b520b79

Browse files
committed
fix(builtins): cast to int before doing - 1 in fixedarr builtin
1 parent af1767d commit b520b79

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/builtins/builtins.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ struct builtin_fixed_arr : builtin {
10691069
ykdatatype *array_wrapper = dt_pool->create("FixedArr");
10701070
array_wrapper->args_.emplace_back(parsed_dt);
10711071
// Add fixed array length
1072-
array_wrapper->args_.emplace_back( dt_pool->create_dimension(length - 1));
1072+
array_wrapper->args_.emplace_back( dt_pool->create_dimension(static_cast<int>(length) - 1));
10731073
array_wrapper->inlinable_literal_ = true;
10741074
return ykobject(array_wrapper);
10751075
}
@@ -1094,7 +1094,7 @@ struct builtin_fixed_arr : builtin {
10941094
auto array_dt = dt_pool->create("FixedArr");
10951095
array_dt->args_.emplace_back(element_data_type);
10961096
// Add fixed array length
1097-
array_dt->args_.emplace_back( dt_pool->create_dimension(args.size() - 1));
1097+
array_dt->args_.emplace_back( dt_pool->create_dimension(static_cast<int>(args.size()) - 1));
10981098
array_dt->inlinable_literal_ = true;// this can be inlined
10991099
// ------------------------
11001100
code << "{";

0 commit comments

Comments
 (0)