Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NoneType' object has no attribute 'subexpressions' #385

Open
19h opened this issue Feb 19, 2024 · 2 comments
Open

AttributeError: 'NoneType' object has no attribute 'subexpressions' #385

19h opened this issue Feb 19, 2024 · 2 comments
Labels
bug Something isn't working priority-high High priority issue

Comments

@19h
Copy link

19h commented Feb 19, 2024

What happened?

Not sure how to properly pin this down:

Decompilation of `__ZN3geo5codec15_readCoastlinesEP8VMP4TileRKNSt3__110shared_ptrINS0_10VectorTileEEE` failed with:

<class 'AttributeError'>

'NoneType' object has no attribute 'subexpressions'

Traceback (most recent call last):
  File "/Users/user/Library/Application Support/Binary Ninja/plugins/dewolf/decompiler/util/widget.py", line 51, in run
    code = self.decompile_for_widget(self.binary_view, self.function)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/Library/Application Support/Binary Ninja/plugins/dewolf/decompiler/util/widget.py", line 67, in decompile_for_widget
    task = decompiler.decompile(function, options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/Library/Application Support/Binary Ninja/plugins/dewolf/decompile.py", line 52, in decompile
    task.code = self._backend.generate([task])
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/Library/Application Support/Binary Ninja/plugins/dewolf/decompiler/backend/codegenerator.py", line 30, in generate
    string_blocks.append(GlobalDeclarationGenerator.from_asts(task.syntax_tree for task in tasks if not task.failed))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/Library/Application Support/Binary Ninja/plugins/dewolf/decompiler/backend/variabledeclarations.py", line 65, in from_asts
    global_variables, extern_constants = GlobalDeclarationGenerator._get_global_variables_and_constants(asts)
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/Library/Application Support/Binary Ninja/plugins/dewolf/decompiler/backend/variabledeclarations.py", line 89, in _get_global_variables_and_constants
    for expression in obj.subexpressions():
                      ^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'subexpressions'

How to reproduce?

Compiling the function __ZN3geo5codec15_readCoastlinesEP8VMP4TileRKNSt3__110shared_ptrINS0_10VectorTileEEE of:

GeoServices.zip

Affected Binary Ninja Version(s)

4.0.4886

@19h 19h added bug Something isn't working priority-high High priority issue labels Feb 19, 2024
@19h
Copy link
Author

19h commented Feb 19, 2024

From what I can see this code (3f6701b#diff-d01ea3c49183d0cb233e53878877ff13282ac4e9cb758f542271fcc1bda09a1bR77-R78) was introduced on January 18th by @rihi and @steffenenders.

@rihi
Copy link
Collaborator

rihi commented May 22, 2024

Does the issue persist with the latest commit on the main branch?
The code related to this error has undergone significant changes since then, and I can no longer replicate the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-high High priority issue
Projects
None yet
Development

No branches or pull requests

2 participants