Skip to content

Commit

Permalink
Revert some of the ArrayProxy smtlib visitor changes made in #1526
Browse files Browse the repository at this point in the history
  • Loading branch information
ekilmer committed Dec 18, 2019
1 parent fae081d commit 1a05ff2
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions manticore/core/smtlib/visitors.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def _method(self, expression, *args):
return value
return self._rebuild(expression, args)

def visit(self, node_arg, use_fixed_point=False):
def visit(self, node, use_fixed_point=False):
"""
The entry point of the visitor.
The exploration algorithm is a DFS post-order traversal
Expand All @@ -76,10 +76,6 @@ def visit(self, node_arg, use_fixed_point=False):
:param use_fixed_point: if True, it runs _methods until a fixed point is found
:type use_fixed_point: Bool
"""
if isinstance(node_arg, ArrayProxy):
node = node_arg.array
else:
node = node_arg

cache = self._cache
visited = set()
Expand Down Expand Up @@ -112,12 +108,6 @@ def visit(self, node_arg, use_fixed_point=False):
old_value = new_value
new_value = self.pop()

if isinstance(node_arg, ArrayProxy):
new_value = ArrayProxy(new_value)
new_value._default = node_arg._default
new_value._written = set(node_arg.written)
new_value._concrete_cache = dict(node_arg._concrete_cache)

self.push(new_value)

@staticmethod
Expand All @@ -134,9 +124,10 @@ class Translator(Visitor):
""" Simple visitor to translate an expression into something else
"""

def _method(self, expression_arg, *args):
def _method(self, expression, *args):
# Special case. Need to get the unsleeved version of the array
expression = expression_arg
if isinstance(expression, ArrayProxy):
expression = expression.array

assert expression.__class__.__mro__[-1] is object
for cls in expression.__class__.__mro__:
Expand Down

0 comments on commit 1a05ff2

Please sign in to comment.