mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix member call on null pointer
when type-checking built-in unary operators
This commit is contained in:
parent
f341cfbfb6
commit
c95108169d
@ -1780,11 +1780,10 @@ bool TypeChecker::visit(UnaryOperation const& _operation)
|
||||
|
||||
_operation.annotation().userDefinedFunction = operatorDefinition;
|
||||
|
||||
TypePointers const& returnParameterTypes = _operation.userDefinedFunctionType()->returnParameterTypes();
|
||||
if (operatorDefinition && !returnParameterTypes.empty())
|
||||
if (operatorDefinition && !_operation.userDefinedFunctionType()->returnParameterTypes().empty())
|
||||
// Use the actual result type from operator definition. Ignore all values but the
|
||||
// first one - in valid code there will be only one anyway.
|
||||
resultType = returnParameterTypes[0];
|
||||
resultType = _operation.userDefinedFunctionType()->returnParameterTypes()[0];
|
||||
_operation.annotation().type = resultType;
|
||||
_operation.annotation().isConstant = false;
|
||||
_operation.annotation().isPure =
|
||||
|
Loading…
Reference in New Issue
Block a user