diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2015-03-11 23:58:25 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2015-03-12 19:53:00 +0800 |
commit | cd3e8c175645e9a6a81b5b719868b1f74a528c65 (patch) | |
tree | 76ae1cf70275f29c60b2745f3d261b957df8f9f3 /ExpressionCompiler.cpp | |
parent | b2fadf6b933e9034d5edb49608329fb0f7d015dd (diff) | |
download | dexon-solidity-cd3e8c175645e9a6a81b5b719868b1f74a528c65.tar.gz dexon-solidity-cd3e8c175645e9a6a81b5b719868b1f74a528c65.tar.zst dexon-solidity-cd3e8c175645e9a6a81b5b719868b1f74a528c65.zip |
Fixing byte array index access code generation
Diffstat (limited to 'ExpressionCompiler.cpp')
-rw-r--r-- | ExpressionCompiler.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ExpressionCompiler.cpp b/ExpressionCompiler.cpp index f00b2d40..3cee40df 100644 --- a/ExpressionCompiler.cpp +++ b/ExpressionCompiler.cpp @@ -133,7 +133,6 @@ void ExpressionCompiler::appendTypeConversion(Type const& _typeOnStack, Type con // conversion from bytes to integer. no need to clean the high bit // only to shift right because of opposite alignment IntegerType const& targetIntegerType = dynamic_cast<IntegerType const&>(_targetType); - // solAssert(targetIntegerType.getNumBits() == typeOnStack.getNumBytes() * 8, "The size should be the same."); m_context << (u256(1) << (256 - typeOnStack.getNumBytes() * 8)) << eth::Instruction::SWAP1 << eth::Instruction::DIV; if (targetIntegerType.getNumBits() < typeOnStack.getNumBytes() * 8) appendTypeConversion(IntegerType(typeOnStack.getNumBytes() * 8), _targetType, _cleanupNeeded); @@ -782,7 +781,7 @@ bool ExpressionCompiler::visit(IndexAccess const& _indexAccess) // no lvalue, just retrieve the value m_context << eth::Instruction::ADD << eth::Instruction::CALLDATALOAD - << ((u256(1) << (256 - 8)) - 1) << eth::Instruction::AND; + << ((u256(0xff) << (256 - 8))) << eth::Instruction::AND; break; case ArrayType::Location::Memory: solAssert(false, "Memory lvalues not yet implemented."); |