From c919cdae037ca4e7d6091235d1bdf3ee5097b804 Mon Sep 17 00:00:00 2001 From: Tigran Avagyan Date: Thu, 22 Jun 2023 16:55:37 +0400 Subject: [PATCH] added reachability field for node which indicates whether the node is reachable from the ENTRY_POINT --- slither/core/cfg/node.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/slither/core/cfg/node.py b/slither/core/cfg/node.py index 2a48bd235..475e2f138 100644 --- a/slither/core/cfg/node.py +++ b/slither/core/cfg/node.py @@ -193,6 +193,8 @@ class Node(SourceMapping): # pylint: disable=too-many-public-methods self.file_scope: "FileScope" = file_scope self._function: Optional["Function"] = None + self._is_reachable: bool = False + ################################################################################### ################################################################################### # region General's properties @@ -234,6 +236,13 @@ class Node(SourceMapping): # pylint: disable=too-many-public-methods def function(self) -> "Function": return self._function + @property + def is_reachable(self) -> bool: + return self._is_reachable + + def set_is_reachable(self, new_is_reachable: bool) -> None: + self._is_reachable = new_is_reachable + # endregion ################################################################################### ###################################################################################