diff options
author | Christian <c@ethdev.com> | 2015-02-14 10:22:49 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2015-02-14 20:35:57 +0800 |
commit | 5c3ea8015c5657c8aaed5b14f7720dbcc4e79219 (patch) | |
tree | d3f4b541464af619dd5ad01ecfb93b46e5eb28ed /ExpressionCompiler.cpp | |
parent | c944976d00de84d9cbe8e3e2388a21f0a323444c (diff) | |
download | dexon-solidity-5c3ea8015c5657c8aaed5b14f7720dbcc4e79219.tar.gz dexon-solidity-5c3ea8015c5657c8aaed5b14f7720dbcc4e79219.tar.zst dexon-solidity-5c3ea8015c5657c8aaed5b14f7720dbcc4e79219.zip |
Forced cleanup for conversion to enum.
Diffstat (limited to 'ExpressionCompiler.cpp')
-rw-r--r-- | ExpressionCompiler.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ExpressionCompiler.cpp b/ExpressionCompiler.cpp index 29ec3d57..0f0e94f2 100644 --- a/ExpressionCompiler.cpp +++ b/ExpressionCompiler.cpp @@ -759,8 +759,11 @@ void ExpressionCompiler::appendTypeConversion(Type const& _typeOnStack, Type con } } } + else if (stackTypeCategory == Type::Category::Enum) + solAssert(targetTypeCategory == Type::Category::Integer || + targetTypeCategory == Type::Category::Enum, ""); else if (stackTypeCategory == Type::Category::Integer || stackTypeCategory == Type::Category::Contract || - stackTypeCategory == Type::Category::IntegerConstant || stackTypeCategory == Type::Category::Enum) + stackTypeCategory == Type::Category::IntegerConstant) { if (targetTypeCategory == Type::Category::String && stackTypeCategory == Type::Category::Integer) { @@ -772,6 +775,9 @@ void ExpressionCompiler::appendTypeConversion(Type const& _typeOnStack, Type con solAssert(typeOnStack.getNumBits() == targetStringType.getNumBytes() * 8, "The size should be the same."); m_context << (u256(1) << (256 - typeOnStack.getNumBits())) << eth::Instruction::MUL; } + else if (targetTypeCategory == Type::Category::Enum) + // just clean + appendTypeConversion(_typeOnStack, *_typeOnStack.getRealType(), true); else { solAssert(targetTypeCategory == Type::Category::Integer || targetTypeCategory == Type::Category::Contract, ""); |