Fixed nullptr dereference [#CLICKHOUSE-3281].

This commit is contained in:
Alexey Milovidov 2017-09-06 05:13:54 +03:00 committed by alexey-milovidov
parent 3b6dd67178
commit 452c40e85e

View File

@ -356,7 +356,6 @@ void processHigherOrderFunction(const String & column_name,
if (lambda && lambda->name == "lambda")
{
const DataTypeExpression * lambda_type = typeid_cast<const DataTypeExpression *>(types[i].get());
const DataTypes & lambda_argument_types = lambda_type->getArgumentTypes();
if (!lambda_type)
throw Exception("Logical error: IFunction::getLambdaArgumentTypes returned data type for lambda expression,"
@ -369,6 +368,8 @@ void processHigherOrderFunction(const String & column_name,
AnalyzeLambdas::LambdaParameters parameters = AnalyzeLambdas::extractLambdaParameters(lambda->arguments->children[0]);
const DataTypes & lambda_argument_types = lambda_type->getArgumentTypes();
if (parameters.size() != lambda_argument_types.size())
throw Exception("DataTypeExpression for lambda function has different number of argument types than number of lambda parameters",
ErrorCodes::LOGICAL_ERROR);