Skip to content

Commit

Permalink
Fix undefined behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
makxenov authored and AndreyMlashkin committed Aug 20, 2024
1 parent b72ed97 commit de25423
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/assigner/include/zkevm_word.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ namespace nil {

template <typename BlueprintFieldType>
std::ostream& operator<<(std::ostream& os, const zkevm_word<BlueprintFieldType>& obj){
const auto bytes = obj.to_uint256be().bytes;
const auto word = obj.to_uint256be();
for (uint8_t i = 0; i < 32; i++) {
os << (int)bytes[i] << " ";
os << (int)word.bytes[i] << " ";
}
return os;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/assigner/test/assigner_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ TEST_F(AssignerTest, conversions_address_to_zkevm_word)

TEST_F(AssignerTest, conversions_hash_to_zkevm_word)
{
ethash::hash256 hash;
ethash::hash256 hash {.bytes = {0}};
hash.bytes[2] = 10;
// conversion to zkevm_word
auto tmp = nil::evm_assigner::zkevm_word<BlueprintFieldType>(hash);
Expand Down

0 comments on commit de25423

Please sign in to comment.