aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-09-10 20:22:11 +0800
committerGitHub <noreply@github.com>2018-09-10 20:22:11 +0800
commitcd26fa8300c37c7c119004acbc2acc67679174a7 (patch)
treef99f90303203d3edcfde35378302ac4e95f25bcb /libsolidity/codegen
parent255eda2ea69cf1996b1d6e1289b47f394ae28712 (diff)
parent9f6a12eeb5b44d7e9de82864d89c98a2349fb929 (diff)
downloaddexon-solidity-cd26fa8300c37c7c119004acbc2acc67679174a7.tar
dexon-solidity-cd26fa8300c37c7c119004acbc2acc67679174a7.tar.gz
dexon-solidity-cd26fa8300c37c7c119004acbc2acc67679174a7.tar.bz2
dexon-solidity-cd26fa8300c37c7c119004acbc2acc67679174a7.tar.lz
dexon-solidity-cd26fa8300c37c7c119004acbc2acc67679174a7.tar.xz
dexon-solidity-cd26fa8300c37c7c119004acbc2acc67679174a7.tar.zst
dexon-solidity-cd26fa8300c37c7c119004acbc2acc67679174a7.zip
Merge pull request #4896 from ethereum/expCleanup
Exp cleanup
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index 4150bc11..45e58bd0 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -2138,7 +2138,9 @@ bool ExpressionCompiler::cleanupNeededForOp(Type::Category _type, Token::Value _
{
if (Token::isCompareOp(_op) || Token::isShiftOp(_op))
return true;
- else if (_type == Type::Category::Integer && (_op == Token::Div || _op == Token::Mod))
+ else if (_type == Type::Category::Integer && (_op == Token::Div || _op == Token::Mod || _op == Token::Exp))
+ // We need cleanup for EXP because 0**0 == 1, but 0**0x100 == 0
+ // It would suffice to clean the exponent, though.
return true;
else
return false;