From 83ef2c60240ba9e5370fcfee073c3b341b5d1b70 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Thu, 13 Feb 2020 18:45:17 +0000 Subject: [PATCH] Get annotations from Expr (#1332) --- mythril/laser/smt/expression.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mythril/laser/smt/expression.py b/mythril/laser/smt/expression.py index 9fa7cef1..c549f818 100644 --- a/mythril/laser/smt/expression.py +++ b/mythril/laser/smt/expression.py @@ -54,6 +54,9 @@ class Expression(Generic[T]): def __hash__(self) -> int: return self.raw.__hash__() + def get_annotations(self, annotation: Any): + return list(filter(lambda x: isinstance(x, annotation), self.annotations)) + G = TypeVar("G", bound=Expression)