Skip to content

Commit

Permalink
fix value_into_vector
Browse files Browse the repository at this point in the history
  • Loading branch information
CblPOK-git committed Jun 27, 2024
1 parent 7fc7a6d commit 6456acc
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions include/nil/blueprint/non_native_marshalling.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,12 @@ namespace nil {
else {
if constexpr (non_native_policy::ratio == 1) {
column_type<BlueprintFieldType> res;
typename BlueprintFieldType::integral_type chopped_val = typename BlueprintFieldType::integral_type::backend_type(input.data.backend().base_data());
if (NonNativeFieldType::modulus_bits < BlueprintFieldType::modulus_bits) {
// set unused bits 0
typename BlueprintFieldType::integral_type base = 1;
typename BlueprintFieldType::integral_type mask = (base << NonNativeFieldType::modulus_bits) - 1;
chopped_val = chopped_val & mask;
}

typename BlueprintFieldType::integral_type chopped_val =
typename BlueprintFieldType::integral_type(
typename NonNativeFieldType::integral_type(input.data)
);

res.push_back(typename BlueprintFieldType::value_type(chopped_val));
return res;
}
Expand Down

0 comments on commit 6456acc

Please sign in to comment.