Browse Source

Padding fixes.

cl-refactor
Christian 10 years ago
parent
commit
47f6c9a5de
  1. 2
      libsolidity/ExpressionCompiler.cpp
  2. 6
      test/SolidityEndToEndTest.cpp

2
libsolidity/ExpressionCompiler.cpp

@ -828,7 +828,7 @@ unsigned ExpressionCompiler::appendExpressionCopyToMemory(Type const& _expectedT
{
_expression.accept(*this);
appendTypeConversion(*_expression.getType(), _expectedType, true);
unsigned const c_numBytes = _expectedType.getCalldataEncodedSize();
unsigned const c_numBytes = CompilerUtils::getPaddedSize(_expectedType.getCalldataEncodedSize());
if (c_numBytes == 0 || c_numBytes > 32)
BOOST_THROW_EXCEPTION(CompilerError()
<< errinfo_sourceLocation(_expression.getLocation())

6
test/SolidityEndToEndTest.cpp

@ -1963,9 +1963,9 @@ BOOST_AUTO_TEST_CASE(event)
function deposit(hash _id, bool _manually) {
if (_manually) {
hash s = 0x50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb20;
log3(msg.value, s, hash(msg.sender), _id);
log3(msg.value, s, hash32(msg.sender), _id);
} else
Deposit(msg.sender, _id, msg.value);
Deposit(hash32(msg.sender), _id, msg.value);
}
}
)";
@ -1991,7 +1991,7 @@ BOOST_AUTO_TEST_CASE(event_lots_of_data)
contract ClientReceipt {
event Deposit(address _from, hash _id, uint _value, bool _flag);
function deposit(hash _id) {
Deposit(msg.sender, _id, msg.value, true);
Deposit(msg.sender, hash32(_id), msg.value, true);
}
}
)";

Loading…
Cancel
Save