aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2016-11-01 02:21:04 +0800
committerGitHub <noreply@github.com>2016-11-01 02:21:04 +0800
commit4633f3def897db0f91237f98cf46e5d84fb05e61 (patch)
tree2dcc45c6ff2c95dc8871469aaa8e71d39807c8d7 /libsolidity
parent2353da71c77dd235b35d16e7e024fa62408df610 (diff)
parent979d18f19c711093cdc7f4112a76bf2135c97119 (diff)
downloaddexon-solidity-4633f3def897db0f91237f98cf46e5d84fb05e61.tar
dexon-solidity-4633f3def897db0f91237f98cf46e5d84fb05e61.tar.gz
dexon-solidity-4633f3def897db0f91237f98cf46e5d84fb05e61.tar.bz2
dexon-solidity-4633f3def897db0f91237f98cf46e5d84fb05e61.tar.lz
dexon-solidity-4633f3def897db0f91237f98cf46e5d84fb05e61.tar.xz
dexon-solidity-4633f3def897db0f91237f98cf46e5d84fb05e61.tar.zst
dexon-solidity-4633f3def897db0f91237f98cf46e5d84fb05e61.zip
Merge pull request #1308 from ethereum/develop
Merge for version 0.4.4
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/ast/Types.cpp5
-rw-r--r--libsolidity/codegen/LValue.cpp8
2 files changed, 5 insertions, 8 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp
index 7cfed3c8..7fe97fa7 100644
--- a/libsolidity/ast/Types.cpp
+++ b/libsolidity/ast/Types.cpp
@@ -349,11 +349,14 @@ TypePointer IntegerType::binaryOperatorResult(Token::Value _operator, TypePointe
return commonType;
if (Token::isBooleanOp(_operator))
return TypePointer();
- // Nothing else can be done with addresses
if (auto intType = dynamic_pointer_cast<IntegerType const>(commonType))
{
+ // Nothing else can be done with addresses
if (intType->isAddress())
return TypePointer();
+ // Signed EXP is not allowed
+ if (Token::Exp == _operator && intType->isSigned())
+ return TypePointer();
}
else if (auto fixType = dynamic_pointer_cast<FixedPointType const>(commonType))
if (Token::Exp == _operator)
diff --git a/libsolidity/codegen/LValue.cpp b/libsolidity/codegen/LValue.cpp
index 553e5518..c1e05792 100644
--- a/libsolidity/codegen/LValue.cpp
+++ b/libsolidity/codegen/LValue.cpp
@@ -231,10 +231,7 @@ void StorageItem::storeValue(Type const& _sourceType, SourceLocation const& _loc
m_context
<< (u256(0x1) << (256 - 8 * dynamic_cast<FixedBytesType const&>(*m_dataType).numBytes()))
<< Instruction::SWAP1 << Instruction::DIV;
- else if (
- m_dataType->category() == Type::Category::Integer &&
- dynamic_cast<IntegerType const&>(*m_dataType).isSigned()
- )
+ else
// remove the higher order bits
m_context
<< (u256(1) << (8 * (32 - m_dataType->storageBytes())))
@@ -242,9 +239,6 @@ void StorageItem::storeValue(Type const& _sourceType, SourceLocation const& _loc
<< Instruction::DUP2
<< Instruction::MUL
<< Instruction::DIV;
- else if (m_dataType->category() == Type::Category::FixedPoint)
- // implementation should be very similar to the integer case.
- solAssert(false, "Not yet implemented - FixedPointType.");
m_context << Instruction::MUL << Instruction::OR;
// stack: value storage_ref updated_value
m_context << Instruction::SWAP1 << Instruction::SSTORE;