aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ExpressionCompiler.cpp
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-10-15 20:37:11 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-10-15 20:37:11 +0800
commita823de2d5863efb45e6d0a9d11e41f511687b831 (patch)
tree0217e435e8ed9e0ea0a71de49b868ad85cb85e79 /libsolidity/ExpressionCompiler.cpp
parent9224c1f7128f92f47ddf3feaf83b57d6d98e0a04 (diff)
downloaddexon-solidity-a823de2d5863efb45e6d0a9d11e41f511687b831.tar
dexon-solidity-a823de2d5863efb45e6d0a9d11e41f511687b831.tar.gz
dexon-solidity-a823de2d5863efb45e6d0a9d11e41f511687b831.tar.bz2
dexon-solidity-a823de2d5863efb45e6d0a9d11e41f511687b831.tar.lz
dexon-solidity-a823de2d5863efb45e6d0a9d11e41f511687b831.tar.xz
dexon-solidity-a823de2d5863efb45e6d0a9d11e41f511687b831.tar.zst
dexon-solidity-a823de2d5863efb45e6d0a9d11e41f511687b831.zip
push() for byte arrays also properly implemented
Diffstat (limited to 'libsolidity/ExpressionCompiler.cpp')
-rw-r--r--libsolidity/ExpressionCompiler.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/libsolidity/ExpressionCompiler.cpp b/libsolidity/ExpressionCompiler.cpp
index 2d3126c8..85302afc 100644
--- a/libsolidity/ExpressionCompiler.cpp
+++ b/libsolidity/ExpressionCompiler.cpp
@@ -624,7 +624,6 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
break;
}
case Location::ByteArrayPush:
- solAssert(false, "Not properly implemented yet");
case Location::ArrayPush:
{
_functionCall.expression().accept(*this);
@@ -651,12 +650,15 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
arguments[0]->accept(*this);
// stack: newLength storageSlot slotOffset argValue
TypePointer type = arguments[0]->annotation().type;
- utils().convertType(*type, *type->mobileType());
- type = type->mobileType();
+ utils().convertType(*type, *arrayType->baseType());
+ type = arrayType->baseType();
utils().moveToStackTop(1 + type->sizeOnStack());
utils().moveToStackTop(1 + type->sizeOnStack());
// stack: newLength argValue storageSlot slotOffset
- StorageItem(m_context, *paramType).storeValue(*type, _functionCall.location(), true);
+ if (function.location() == Location::ArrayPush)
+ StorageItem(m_context, *paramType).storeValue(*type, _functionCall.location(), true);
+ else
+ StorageByteArrayElement(m_context).storeValue(*type, _functionCall.location(), true);
break;
}
default: