Browse Source

Correctly check for string prefix plus indentation change.

cl-refactor
Christian 10 years ago
parent
commit
8eee0a2033
  1. 2
      libsolidity/ExpressionCompiler.cpp
  2. 12
      libsolidity/Types.cpp

2
libsolidity/ExpressionCompiler.cpp

@ -291,7 +291,7 @@ void ExpressionCompiler::endVisit(MemberAccess const& _memberAccess)
IntegerType(0, IntegerType::Modifier::ADDRESS), true); IntegerType(0, IntegerType::Modifier::ADDRESS), true);
m_context << eth::Instruction::BALANCE; m_context << eth::Instruction::BALANCE;
} }
else if (member == "send" || member.substr(0, 4) == "call") else if (member == "send" || member.substr(0, min<size_t>(member.size(), 4)) == "call")
appendTypeConversion(*_memberAccess.getExpression().getType(), appendTypeConversion(*_memberAccess.getExpression().getType(),
IntegerType(0, IntegerType::Modifier::ADDRESS), true); IntegerType(0, IntegerType::Modifier::ADDRESS), true);
else else

12
libsolidity/Types.cpp

@ -193,13 +193,17 @@ u256 IntegerType::literalValue(Literal const& _literal) const
} }
const MemberList IntegerType::AddressMemberList = const MemberList IntegerType::AddressMemberList =
MemberList({{"balance", make_shared<IntegerType const>(256)}, MemberList({{"balance",
{"callstring32", make_shared<FunctionType const>(TypePointers({make_shared<StaticStringType const>(32)}), make_shared<IntegerType const>(256)},
{"callstring32",
make_shared<FunctionType const>(TypePointers({make_shared<StaticStringType const>(32)}),
TypePointers(), FunctionType::Location::BARE)}, TypePointers(), FunctionType::Location::BARE)},
{"callstring32string32", make_shared<FunctionType const>(TypePointers({make_shared<StaticStringType const>(32), {"callstring32string32",
make_shared<FunctionType const>(TypePointers({make_shared<StaticStringType const>(32),
make_shared<StaticStringType const>(32)}), make_shared<StaticStringType const>(32)}),
TypePointers(), FunctionType::Location::BARE)}, TypePointers(), FunctionType::Location::BARE)},
{"send", make_shared<FunctionType const>(TypePointers({make_shared<IntegerType const>(256)}), {"send",
make_shared<FunctionType const>(TypePointers({make_shared<IntegerType const>(256)}),
TypePointers(), FunctionType::Location::SEND)}}); TypePointers(), FunctionType::Location::SEND)}});
shared_ptr<StaticStringType> StaticStringType::smallestTypeForLiteral(string const& _literal) shared_ptr<StaticStringType> StaticStringType::smallestTypeForLiteral(string const& _literal)

Loading…
Cancel
Save