aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/ExpressionCompiler.cpp
diff options
context:
space:
mode:
authorhydai <z54981220@gmail.com>2018-11-29 16:34:17 +0800
committerhydai <z54981220@gmail.com>2018-11-29 17:07:18 +0800
commit9326adc3db513353da51d9732d1c92b33ecd4d16 (patch)
treeacc49affdc911984d67a37fe7e61c8bc4bca94c6 /libsolidity/codegen/ExpressionCompiler.cpp
parentb4086ac87037813eb553e92839bbc40de6bbd9ac (diff)
downloaddexon-solidity-9326adc3db513353da51d9732d1c92b33ecd4d16.tar
dexon-solidity-9326adc3db513353da51d9732d1c92b33ecd4d16.tar.gz
dexon-solidity-9326adc3db513353da51d9732d1c92b33ecd4d16.tar.bz2
dexon-solidity-9326adc3db513353da51d9732d1c92b33ecd4d16.tar.lz
dexon-solidity-9326adc3db513353da51d9732d1c92b33ecd4d16.tar.xz
dexon-solidity-9326adc3db513353da51d9732d1c92b33ecd4d16.tar.zst
dexon-solidity-9326adc3db513353da51d9732d1c92b33ecd4d16.zip
Replace IntegerType(256) with static function IntegerType::uint256()
Diffstat (limited to 'libsolidity/codegen/ExpressionCompiler.cpp')
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index c9a1e076..87eecd2e 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -631,7 +631,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
_functionCall.expression().accept(*this);
arguments.front()->accept(*this);
- utils().convertType(*arguments.front()->annotation().type, IntegerType(256), true);
+ utils().convertType(*arguments.front()->annotation().type, IntegerType::uint256(), true);
// Note that function is not the original function, but the ".gas" function.
// Its values of gasSet and valueSet is equal to the original function's though.
unsigned stackDepth = (function.gasSet() ? 1 : 0) + (function.valueSet() ? 1 : 0);
@@ -814,13 +814,13 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
case FunctionType::Kind::MulMod:
{
arguments[2]->accept(*this);
- utils().convertType(*arguments[2]->annotation().type, IntegerType(256));
+ utils().convertType(*arguments[2]->annotation().type, IntegerType::uint256());
m_context << Instruction::DUP1 << Instruction::ISZERO;
m_context.appendConditionalInvalid();
for (unsigned i = 1; i < 3; i ++)
{
arguments[2 - i]->accept(*this);
- utils().convertType(*arguments[2 - i]->annotation().type, IntegerType(256));
+ utils().convertType(*arguments[2 - i]->annotation().type, IntegerType::uint256());
}
if (function.kind() == FunctionType::Kind::AddMod)
m_context << Instruction::ADDMOD;
@@ -904,7 +904,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
// Fetch requested length.
arguments[0]->accept(*this);
- utils().convertType(*arguments[0]->annotation().type, IntegerType(256));
+ utils().convertType(*arguments[0]->annotation().type, IntegerType::uint256());
// Stack: requested_length
utils().fetchFreeMemoryPointer();
@@ -1452,7 +1452,7 @@ bool ExpressionCompiler::visit(IndexAccess const& _indexAccess)
TypePointers{keyType}
);
m_context << Instruction::SWAP1;
- utils().storeInMemoryDynamic(IntegerType(256));
+ utils().storeInMemoryDynamic(IntegerType::uint256());
utils().toSizeAfterFreeMemoryPointer();
}
else
@@ -1461,7 +1461,7 @@ bool ExpressionCompiler::visit(IndexAccess const& _indexAccess)
appendExpressionCopyToMemory(*keyType, *_indexAccess.indexExpression());
m_context << Instruction::SWAP1;
solAssert(CompilerUtils::freeMemoryPointer >= 0x40, "");
- utils().storeInMemoryDynamic(IntegerType(256));
+ utils().storeInMemoryDynamic(IntegerType::uint256());
m_context << u256(0);
}
m_context << Instruction::KECCAK256;
@@ -1474,7 +1474,7 @@ bool ExpressionCompiler::visit(IndexAccess const& _indexAccess)
solAssert(_indexAccess.indexExpression(), "Index expression expected.");
_indexAccess.indexExpression()->accept(*this);
- utils().convertType(*_indexAccess.indexExpression()->annotation().type, IntegerType(256), true);
+ utils().convertType(*_indexAccess.indexExpression()->annotation().type, IntegerType::uint256(), true);
// stack layout: <base_ref> [<length>] <index>
ArrayUtils(m_context).accessIndex(arrayType);
switch (arrayType.location())
@@ -1510,7 +1510,7 @@ bool ExpressionCompiler::visit(IndexAccess const& _indexAccess)
solAssert(_indexAccess.indexExpression(), "Index expression expected.");
_indexAccess.indexExpression()->accept(*this);
- utils().convertType(*_indexAccess.indexExpression()->annotation().type, IntegerType(256), true);
+ utils().convertType(*_indexAccess.indexExpression()->annotation().type, IntegerType::uint256(), true);
// stack layout: <value> <index>
// check out-of-bounds access
m_context << u256(fixedBytesType.numBytes());