Skip to content

Commit

Permalink
Merge pull request #1571 from AntelopeIO/main_catchup
Browse files Browse the repository at this point in the history
Catchup `hotstuff_integration` with the latest changes in `main`
  • Loading branch information
greg7mdp authored Aug 27, 2023
2 parents aa926f0 + ceed0e1 commit d6cf723
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion libraries/chain/webassembly/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ namespace eosio { namespace chain { namespace webassembly {
bool is_negative = (*val < 0);
unsigned __int128 val_magnitude;

// negate after conversion to unsigned to avoid possible integer overflow
if( is_negative )
val_magnitude = static_cast<unsigned __int128>(-*val); // Works even if val is at the lowest possible value of a int128_t
val_magnitude = -static_cast<unsigned __int128>(*val); // Works even if val is at the lowest possible value of a int128_t
else
val_magnitude = static_cast<unsigned __int128>(*val);

Expand Down
2 changes: 1 addition & 1 deletion libraries/libfc/libraries/bls12-381
4 changes: 2 additions & 2 deletions libraries/wasm-jit/Source/WAST/ParseNumbers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ bool tryParseInt(ParseState& state,UnsignedInt& outUnsignedInt,I64 minSignedValu
{
case t_decimalInt:
isNegative = parseSign(nextChar);
u64 = parseDecimalUnsignedInt(nextChar,state,isNegative ? U64(-minSignedValue) : maxUnsignedValue,"int literal");
u64 = parseDecimalUnsignedInt(nextChar,state,isNegative ? -U64(minSignedValue) : maxUnsignedValue,"int literal");
break;
case t_hexInt:
isNegative = parseSign(nextChar);
Expand All @@ -239,7 +239,7 @@ bool tryParseInt(ParseState& state,UnsignedInt& outUnsignedInt,I64 minSignedValu
return false;
};

outUnsignedInt = isNegative ? UnsignedInt(-I64(u64)) : UnsignedInt(u64);
outUnsignedInt = isNegative ? -UnsignedInt(u64) : UnsignedInt(u64);

++state.nextToken;
WAVM_ASSERT_THROW(nextChar <= state.string + state.nextToken->begin);
Expand Down
2 changes: 1 addition & 1 deletion tutorials/bios-boot-tutorial/bios-boot-tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def startNode(nodeIndex, account):
' --config-dir ' + os.path.abspath(dir) +
' --data-dir ' + os.path.abspath(dir) +
' --chain-state-db-size-mb 1024'
' --http-server-address 127.0.0.1:' + str(8000 + nodeIndex) +
' --http-server-address 127.0.0.1:' + str(args.http_port + nodeIndex) +
' --p2p-listen-endpoint 127.0.0.1:' + str(9000 + nodeIndex) +
' --max-clients ' + str(maxClients) +
' --p2p-max-nodes-per-host ' + str(maxClients) +
Expand Down

0 comments on commit d6cf723

Please sign in to comment.