Skip to content

Commit

Permalink
[TypeError@substitute_visitor.py:37] TypeError (#363)
Browse files Browse the repository at this point in the history
Co-authored-by: rihi <[email protected]>
Co-authored-by: rihi <[email protected]>
  • Loading branch information
3 people authored Nov 23, 2023
1 parent 4acb7f0 commit ca7efe0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 3 additions & 3 deletions decompiler/structures/pseudo/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from decompiler.util.insertion_ordered_set import InsertionOrderedSet

from .expressions import Constant, Expression, FunctionSymbol, ImportedFunctionSymbol, IntrinsicSymbol, Symbol, Tag, Variable
from .expressions import Constant, Expression, IntrinsicSymbol, Symbol, Tag, Variable
from .typing import CustomType, Pointer, Type, UnknownType

T = TypeVar("T")
Expand Down Expand Up @@ -470,7 +470,7 @@ class Call(Operation):

def __init__(
self,
function: Union[FunctionSymbol, ImportedFunctionSymbol, IntrinsicSymbol, Variable],
function: Expression,
parameter: List[Expression],
vartype: Type = UnknownType(),
writes_memory: Optional[int] = None,
Expand Down Expand Up @@ -522,7 +522,7 @@ def requirements_iter(self) -> Iterator[Variable]:
yield from super().requirements_iter

@property
def function(self) -> Union[FunctionSymbol, ImportedFunctionSymbol, IntrinsicSymbol, Variable]:
def function(self) -> Expression:
"""Return the name of the function called."""
return self._function

Expand Down
5 changes: 1 addition & 4 deletions decompiler/structures/visitors/substitute_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
Continue,
DataflowObject,
Expression,
FunctionSymbol,
GenericBranch,
ImportedFunctionSymbol,
IntrinsicSymbol,
ListOperation,
MemPhi,
Operation,
Expand Down Expand Up @@ -152,7 +149,7 @@ def visit_binary_operation(self, op: BinaryOperation) -> Optional[DataflowObject

def visit_call(self, op: Call) -> Optional[DataflowObject]:
if (function_replacement := op.function.accept(self)) is not None:
op._function = _assert_type(function_replacement, Union[FunctionSymbol, ImportedFunctionSymbol, IntrinsicSymbol, Variable])
op._function = _assert_type(function_replacement, Expression)

return self._visit_operation(op)

Expand Down

0 comments on commit ca7efe0

Please sign in to comment.