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

[python] unable to resolve full names for foo.bar()[0] #4558

Open
xavierpinho opened this issue May 14, 2024 · 0 comments
Open

[python] unable to resolve full names for foo.bar()[0] #4558

xavierpinho opened this issue May 14, 2024 · 0 comments
Labels
bug Something isn't working python Relates to pysrc2cpg type recovery Concerns Joern's WIP type recovery

Comments

@xavierpinho
Copy link
Contributor

Setup

Observe the typeFullName of x (inlined as a comment) in the following samples:

import foo
x = foo[0] # x.typeFullName = foo.py:<module>.<indexAccess>
import foo
x = foo()[0] # x.typeFullName = foo.py:<module>.<indexAccess>
import foo
x = foo.bar() # x.typeFullName = foo.py:<module>.bar.<returnValue>
import foo
x = foo.bar()[0] # x.typeFullName = ANY

Last sample's output should likely be foo.py<module>.bar.<returnValue>.<indexAccess>. (Also not certain if foo[0] and foo()[0] should share the same full name, but that's beside the point here.)

Discussion

With some preliminary debugging over XTypeRecovery, it looks like bar is missing from the symbol table at the time of calling getIndexAccessTypes.

Credit for finding: @tajobe

@xavierpinho xavierpinho added bug Something isn't working python Relates to pysrc2cpg type recovery Concerns Joern's WIP type recovery labels May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working python Relates to pysrc2cpg type recovery Concerns Joern's WIP type recovery
Projects
None yet
Development

No branches or pull requests

1 participant