aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-11-24 21:54:37 +0800
committerchriseth <c@ethdev.com>2015-11-24 21:54:37 +0800
commit68f1da1e3ad6ab914e8f633ac7f661b38894ca2b (patch)
tree92850d5bd017c4eb2ecdd2da61eb8978f1ac1c31 /libsolidity/codegen
parent588e4232eb55d501aea5c7bff513843815b0fd52 (diff)
downloaddexon-solidity-68f1da1e3ad6ab914e8f633ac7f661b38894ca2b.tar
dexon-solidity-68f1da1e3ad6ab914e8f633ac7f661b38894ca2b.tar.gz
dexon-solidity-68f1da1e3ad6ab914e8f633ac7f661b38894ca2b.tar.bz2
dexon-solidity-68f1da1e3ad6ab914e8f633ac7f661b38894ca2b.tar.lz
dexon-solidity-68f1da1e3ad6ab914e8f633ac7f661b38894ca2b.tar.xz
dexon-solidity-68f1da1e3ad6ab914e8f633ac7f661b38894ca2b.tar.zst
dexon-solidity-68f1da1e3ad6ab914e8f633ac7f661b38894ca2b.zip
Fixed string inside struct allocation bug.
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r--libsolidity/codegen/ArrayUtils.cpp2
-rw-r--r--libsolidity/codegen/Compiler.h7
-rw-r--r--libsolidity/codegen/CompilerUtils.cpp2
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp2
4 files changed, 3 insertions, 10 deletions
diff --git a/libsolidity/codegen/ArrayUtils.cpp b/libsolidity/codegen/ArrayUtils.cpp
index ba26caa6..f1acce31 100644
--- a/libsolidity/codegen/ArrayUtils.cpp
+++ b/libsolidity/codegen/ArrayUtils.cpp
@@ -271,7 +271,7 @@ void ArrayUtils::copyArrayToStorage(ArrayType const& _targetType, ArrayType cons
void ArrayUtils::copyArrayToMemory(ArrayType const& _sourceType, bool _padToWordBoundaries) const
{
solAssert(
- _sourceType.baseType()->calldataEncodedSize() > 0,
+ !_sourceType.baseType()->isDynamicallySized(),
"Nested dynamic arrays not implemented here."
);
CompilerUtils utils(m_context);
diff --git a/libsolidity/codegen/Compiler.h b/libsolidity/codegen/Compiler.h
index 14314434..9d069f7c 100644
--- a/libsolidity/codegen/Compiler.h
+++ b/libsolidity/codegen/Compiler.h
@@ -92,13 +92,6 @@ private:
void registerStateVariables(ContractDefinition const& _contract);
void initializeStateVariables(ContractDefinition const& _contract);
- /// Initialises all memory arrays in the local variables to point to an empty location.
- void initialiseMemoryArrays(std::vector<VariableDeclaration const*> _variables);
- /// Pushes the initialised value of the given type to the stack. If the type is a memory
- /// reference type, allocates memory and pushes the memory pointer.
- /// Not to be used for storage references.
- void initialiseInMemory(Type const& _type);
-
virtual bool visit(VariableDeclaration const& _variableDeclaration) override;
virtual bool visit(FunctionDefinition const& _function) override;
virtual bool visit(IfStatement const& _ifStatement) override;
diff --git a/libsolidity/codegen/CompilerUtils.cpp b/libsolidity/codegen/CompilerUtils.cpp
index ce20f2d1..2ebf5b64 100644
--- a/libsolidity/codegen/CompilerUtils.cpp
+++ b/libsolidity/codegen/CompilerUtils.cpp
@@ -613,7 +613,7 @@ void CompilerUtils::convertType(Type const& _typeOnStack, Type const& _targetTyp
}
}
-void CompilerUtils::pushZeroValue(const Type& _type)
+void CompilerUtils::pushZeroValue(Type const& _type)
{
auto const* referenceType = dynamic_cast<ReferenceType const*>(&_type);
if (!referenceType || referenceType->location() == DataLocation::Storage)
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index 05d9ea1c..1a089d63 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -1226,7 +1226,7 @@ void ExpressionCompiler::appendExternalFunctionCall(
else
for (auto const& retType: _functionType.returnParameterTypes())
{
- solAssert(retType->calldataEncodedSize() > 0, "Unable to return dynamic type from external call.");
+ solAssert(!retType->isDynamicallySized(), "Unable to return dynamic type from external call.");
retSize += retType->calldataEncodedSize();
}