Crash fix, parseTypeName can return null.

This commit is contained in:
chriseth
2017-08-28 15:13:02 +02:00
parent d15cde2aa8
commit 122e65f8f4
3 changed files with 18 additions and 1 deletions
+4 -1
View File
@@ -1244,7 +1244,10 @@ ASTPointer<Expression> Parser::parseLeftHandSideExpression(
{
expectToken(Token::New);
ASTPointer<TypeName> typeName(parseTypeName(false));
nodeFactory.setEndPositionFromNode(typeName);
if (typeName)
nodeFactory.setEndPositionFromNode(typeName);
else
nodeFactory.markEndPosition();
expression = nodeFactory.createNode<NewExpression>(typeName);
}
else