mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Assertions that throw InternalCompilerErrors.
This commit is contained in:
+2
-4
@@ -39,8 +39,7 @@ void CompilerUtils::loadFromMemory(unsigned _offset, unsigned _bytes, bool _left
|
||||
return;
|
||||
}
|
||||
eth::Instruction load = _fromCalldata ? eth::Instruction::CALLDATALOAD : eth::Instruction::MLOAD;
|
||||
if (asserts(_bytes <= 32))
|
||||
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Memory load of more than 32 bytes requested."));
|
||||
solAssert(_bytes <= 32, "Memory load of more than 32 bytes requested.");
|
||||
if (_bytes == 32)
|
||||
m_context << u256(_offset) << load;
|
||||
else
|
||||
@@ -63,8 +62,7 @@ void CompilerUtils::storeInMemory(unsigned _offset, unsigned _bytes, bool _leftA
|
||||
m_context << eth::Instruction::POP;
|
||||
return;
|
||||
}
|
||||
if (asserts(_bytes <= 32))
|
||||
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Memory store of more than 32 bytes requested."));
|
||||
solAssert(_bytes <= 32, "Memory store of more than 32 bytes requested.");
|
||||
if (_bytes != 32 && !_leftAligned)
|
||||
// shift the value accordingly before storing
|
||||
m_context << (u256(1) << ((32 - _bytes) * 8)) << eth::Instruction::MUL;
|
||||
|
||||
Reference in New Issue
Block a user