From 21b6aa92ffe6f5662a234e6e290e842e963917d1 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 25 Aug 2016 13:25:30 +0200 Subject: Disallow fallback function to return values. --- libsolidity/analysis/TypeChecker.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libsolidity/analysis') diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 6b2c1cb8..235fcabd 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -94,6 +94,8 @@ bool TypeChecker::visit(ContractDefinition const& _contract) fallbackFunction = function; if (!fallbackFunction->parameters().empty()) typeError(fallbackFunction->parameterList().location(), "Fallback function cannot take parameters."); + if (!fallbackFunction->returnParameters().empty()) + typeError(fallbackFunction->returnParameterList()->location(), "Fallback function cannot return values."); } } if (!function->isImplemented()) -- cgit