Always perform cleanup for EXP.

This commit is contained in:
chriseth 2018-09-04 16:51:22 +02:00
parent 7118f53974
commit 120438c0cf

View File

@ -2138,7 +2138,9 @@ bool ExpressionCompiler::cleanupNeededForOp(Type::Category _type, Token::Value _
{ {
if (Token::isCompareOp(_op) || Token::isShiftOp(_op)) if (Token::isCompareOp(_op) || Token::isShiftOp(_op))
return true; 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; return true;
else else
return false; return false;