Skip to content

Commit

Permalink
Fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
rihi committed Nov 16, 2023
1 parent 7b835e0 commit 6c1a88a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion decompiler/backend/variabledeclarations.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,14 @@ def _get_global_variables_and_constants(asts: Iterable[AbstractSyntaxTree]) -> t
global_variables = InsertionOrderedSet()
extern_constants = InsertionOrderedSet()

# if this gets more complex, a visitor pattern should perhaps be used instead
def handle_obj(obj: DataflowObject):
match obj:
case GlobalVariable():
global_variables.add(obj)
if isinstance(obj.initial_value, Expression):
handle_obj(obj.initial_value)
for subexpression in obj.initial_value.subexpressions():
handle_obj(subexpression)

case ExternConstant():
extern_constants.add(obj)
Expand Down

0 comments on commit 6c1a88a

Please sign in to comment.