diff options
author | chriseth <c@ethdev.com> | 2015-12-10 00:53:15 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-12-10 00:57:34 +0800 |
commit | 39f57a9c718159448b0f9df199c3a0a019f32ca2 (patch) | |
tree | 27b593c6539cb8711f2623f3a0d12347bc793183 /libsolidity | |
parent | 15a1468c3fcf520b9c8f0af22159ea729cf9f085 (diff) | |
download | dexon-solidity-39f57a9c718159448b0f9df199c3a0a019f32ca2.tar.gz dexon-solidity-39f57a9c718159448b0f9df199c3a0a019f32ca2.tar.zst dexon-solidity-39f57a9c718159448b0f9df199c3a0a019f32ca2.zip |
Fix: Segfaults connected to paramater types.
parameterTypes does not return by const reference anymore.
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 4 | ||||
-rw-r--r-- | libsolidity/codegen/ExpressionCompiler.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 851266bd..425f9299 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -950,7 +950,7 @@ bool TypeChecker::visit(FunctionCall const& _functionCall) else _functionCall.annotation().type = make_shared<TupleType>(functionType->returnParameterTypes()); - TypePointers const& parameterTypes = functionType->parameterTypes(); + TypePointers parameterTypes = functionType->parameterTypes(); if (!functionType->takesArbitraryParameters() && parameterTypes.size() != arguments.size()) { string msg = @@ -1079,7 +1079,7 @@ void TypeChecker::endVisit(NewExpression const& _newExpression) ); auto contractType = make_shared<ContractType>(*contract); - TypePointers const& parameterTypes = contractType->constructorType()->parameterTypes(); + TypePointers parameterTypes = contractType->constructorType()->parameterTypes(); _newExpression.annotation().type = make_shared<FunctionType>( parameterTypes, TypePointers{contractType}, diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index a090a28c..dcdab2a7 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -85,7 +85,7 @@ void ExpressionCompiler::appendStateVariableAccessor(VariableDeclaration const& CompilerContext::LocationSetter locationSetter(m_context, _varDecl); FunctionType accessorType(_varDecl); - TypePointers const& paramTypes = accessorType.parameterTypes(); + TypePointers paramTypes = accessorType.parameterTypes(); // retrieve the position of the variable auto const& location = m_context.storageLocationOfVariable(_varDecl); @@ -380,7 +380,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall) else functionType = dynamic_pointer_cast<FunctionType const>(_functionCall.expression().annotation().type); - TypePointers const& parameterTypes = functionType->parameterTypes(); + TypePointers parameterTypes = functionType->parameterTypes(); vector<ASTPointer<Expression const>> const& callArguments = _functionCall.arguments(); vector<ASTPointer<ASTString>> const& callArgumentNames = _functionCall.names(); if (!functionType->takesArbitraryParameters()) |