From 122e65f8f496b0b20406cc968a2e48e6434d1a8f Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 28 Aug 2017 14:50:18 +0200 Subject: Crash fix, parseTypeName can return null. --- libsolidity/parsing/Parser.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libsolidity/parsing') diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp index 4fc8fd13..ce8a9f01 100644 --- a/libsolidity/parsing/Parser.cpp +++ b/libsolidity/parsing/Parser.cpp @@ -1244,7 +1244,10 @@ ASTPointer Parser::parseLeftHandSideExpression( { expectToken(Token::New); ASTPointer typeName(parseTypeName(false)); - nodeFactory.setEndPositionFromNode(typeName); + if (typeName) + nodeFactory.setEndPositionFromNode(typeName); + else + nodeFactory.markEndPosition(); expression = nodeFactory.createNode(typeName); } else -- cgit