aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-04-10 17:22:26 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-04-10 18:09:34 +0800
commit3eedbc6a9c60888dd967d6673a34511947da4aa1 (patch)
tree0a6e356f44df3763acb57327b34ae621f80cf068 /libsolidity/codegen
parentb52614116e9c72d840b375b0bbb1c56a63df3680 (diff)
downloaddexon-solidity-3eedbc6a9c60888dd967d6673a34511947da4aa1.tar.gz
dexon-solidity-3eedbc6a9c60888dd967d6673a34511947da4aa1.tar.zst
dexon-solidity-3eedbc6a9c60888dd967d6673a34511947da4aa1.zip
Error when using no parentheses in modifier-style constructor calls.
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r--libsolidity/codegen/ContractCompiler.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp
index 3ca0b69d..5cb37103 100644
--- a/libsolidity/codegen/ContractCompiler.cpp
+++ b/libsolidity/codegen/ContractCompiler.cpp
@@ -222,7 +222,7 @@ void ContractCompiler::appendBaseConstructor(FunctionDefinition const& _construc
if (auto inheritanceSpecifier = dynamic_cast<InheritanceSpecifier const*>(baseArgumentNode))
arguments = inheritanceSpecifier->arguments();
else if (auto modifierInvocation = dynamic_cast<ModifierInvocation const*>(baseArgumentNode))
- arguments = &modifierInvocation->arguments();
+ arguments = modifierInvocation->arguments();
solAssert(arguments, "");
solAssert(arguments->size() == constructorType.parameterTypes().size(), "");
for (unsigned i = 0; i < arguments->size(); ++i)
@@ -897,13 +897,16 @@ void ContractCompiler::appendModifierOrFunctionCode()
);
ModifierDefinition const& modifier = m_context.resolveVirtualFunctionModifier(nonVirtualModifier);
CompilerContext::LocationSetter locationSetter(m_context, modifier);
- solAssert(modifier.parameters().size() == modifierInvocation->arguments().size(), "");
+ std::vector<ASTPointer<Expression>> const& modifierArguments =
+ modifierInvocation->arguments() ? *modifierInvocation->arguments() : std::vector<ASTPointer<Expression>>();
+
+ solAssert(modifier.parameters().size() == modifierArguments.size(), "");
for (unsigned i = 0; i < modifier.parameters().size(); ++i)
{
m_context.addVariable(*modifier.parameters()[i]);
addedVariables.push_back(modifier.parameters()[i].get());
compileExpression(
- *modifierInvocation->arguments()[i],
+ *modifierArguments[i],
modifier.parameters()[i]->annotation().type
);
}