diff options
author | chriseth <chris@ethereum.org> | 2017-08-28 20:50:18 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-08-28 21:13:02 +0800 |
commit | 122e65f8f496b0b20406cc968a2e48e6434d1a8f (patch) | |
tree | b623153dd3a068c45781e206e7c4b742f8d6cf7f /libsolidity/parsing | |
parent | d15cde2aa88f39f67025bd40168f219232dad1d6 (diff) | |
download | dexon-solidity-122e65f8f496b0b20406cc968a2e48e6434d1a8f.tar.gz dexon-solidity-122e65f8f496b0b20406cc968a2e48e6434d1a8f.tar.zst dexon-solidity-122e65f8f496b0b20406cc968a2e48e6434d1a8f.zip |
Crash fix, parseTypeName can return null.
Diffstat (limited to 'libsolidity/parsing')
-rw-r--r-- | libsolidity/parsing/Parser.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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<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 |