diff --git a/src/Control/Abstract/Value.hs b/src/Control/Abstract/Value.hs index 6f1258b8c..6b7a29734 100644 --- a/src/Control/Abstract/Value.hs +++ b/src/Control/Abstract/Value.hs @@ -299,6 +299,8 @@ class AbstractIntro value => AbstractValue term address value carrier where -- | Extract the environment from any scoped object (e.g. classes, namespaces, etc). scopedEnvironment :: value -> Evaluator term address value carrier (Maybe address) + object :: address -> Evaluator term address value carrier value + -- TODO rethink whether this function is necessary. makeNamespace :: ( AbstractValue term address value m diff --git a/src/Data/Abstract/Value/Abstract.hs b/src/Data/Abstract/Value/Abstract.hs index a08312b3f..ea7db4fc2 100644 --- a/src/Data/Abstract/Value/Abstract.hs +++ b/src/Data/Abstract/Value/Abstract.hs @@ -133,3 +133,4 @@ instance AbstractValue term address Abstract m where liftComparison _ _ _ = pure Abstract castToInteger _ = pure Abstract + object _ = pure Abstract diff --git a/src/Data/Abstract/Value/Concrete.hs b/src/Data/Abstract/Value/Concrete.hs index 175b2683e..8623b2de5 100644 --- a/src/Data/Abstract/Value/Concrete.hs +++ b/src/Data/Abstract/Value/Concrete.hs @@ -367,6 +367,8 @@ instance ( Member (Allocator address) sig castToInteger (Float (Number.Decimal i)) = pure (Integer (Number.Integer (coefficient (normalize i)))) castToInteger i = throwValueError (NumericError i) + object frameAddress = pure (Object frameAddress) + -- | The type of exceptions that can be thrown when constructing values in 'Value'’s 'MonadValue' instance. data ValueError term address resume where StringError :: Value term address -> ValueError term address Text