aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-09-10 22:33:47 +0800
committerGitHub <noreply@github.com>2018-09-10 22:33:47 +0800
commit6402b8382661ae738faa07c9dbd9af6358e61f6c (patch)
tree77a6636ab3583bbd240e1203ab8fd6b6d7819cc2 /libsolidity/codegen
parentb9164eaba2a192428a27bac045c529c438599af7 (diff)
parent3b7be594cf046cc34864cefbd3cf0f5159770163 (diff)
downloaddexon-solidity-6402b8382661ae738faa07c9dbd9af6358e61f6c.tar
dexon-solidity-6402b8382661ae738faa07c9dbd9af6358e61f6c.tar.gz
dexon-solidity-6402b8382661ae738faa07c9dbd9af6358e61f6c.tar.bz2
dexon-solidity-6402b8382661ae738faa07c9dbd9af6358e61f6c.tar.lz
dexon-solidity-6402b8382661ae738faa07c9dbd9af6358e61f6c.tar.xz
dexon-solidity-6402b8382661ae738faa07c9dbd9af6358e61f6c.tar.zst
dexon-solidity-6402b8382661ae738faa07c9dbd9af6358e61f6c.zip
Merge pull request #4938 from ethereum/expCleanup0425
[backport] 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 4bcc1fa9..f38c1e67 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -2069,7 +2069,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;