From a4a139ecaa3b9ed06d1ac43824d67e9470ba331a Mon Sep 17 00:00:00 2001 From: Vladislav Volosnikov Date: Sat, 9 Jul 2022 14:34:26 +0300 Subject: [PATCH] Add check ElementaryTypeNameExpression in copy_expression --- slither/utils/expression_manipulations.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/slither/utils/expression_manipulations.py b/slither/utils/expression_manipulations.py index 24d43299b..1a300c39b 100644 --- a/slither/utils/expression_manipulations.py +++ b/slither/utils/expression_manipulations.py @@ -9,6 +9,7 @@ from slither.core.expressions.assignment_operation import AssignmentOperation from slither.core.expressions.binary_operation import BinaryOperation from slither.core.expressions.call_expression import CallExpression from slither.core.expressions.conditional_expression import ConditionalExpression +from slither.core.expressions.elementary_type_name_expression import ElementaryTypeNameExpression from slither.core.expressions.expression import Expression from slither.core.expressions.identifier import Identifier from slither.core.expressions.index_access import IndexAccess @@ -80,7 +81,10 @@ class SplitTernaryExpression: if isinstance(expression, ConditionalExpression): raise SlitherException("Nested ternary operator not handled") - if isinstance(expression, (Literal, Identifier, IndexAccess, NewArray, NewContract)): + if isinstance( + expression, + (Literal, Identifier, IndexAccess, NewArray, NewContract, ElementaryTypeNameExpression), + ): return # case of lib