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

[TypeRecovery] include <returnValue> dummy for index accesses of calls #4657

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

xavierpinho
Copy link
Contributor

@xavierpinho xavierpinho commented Jun 12, 2024

It was observed (#4558) a discrepancy between typeFullNames in Python for the following two samples:

from helpers import foo
x = foo()
y = x[0] # y.typeFullName = helpers.py:<module>.foo.<returnValue>.<indexAccess>

vs

from helpers import foo
y = foo()[0] # y.typeFullName = helpers.py:<module>.foo.<indexAccess>

The difference is the missing <returnValue> dummy in the second sample. This patch checks (in getIndexAccessTypes) whether the indexAccess' target is a call and that there's already in the symbol table an entry for it.

@xavierpinho xavierpinho added python Relates to pysrc2cpg type recovery Concerns Joern's WIP type recovery labels Jun 12, 2024
@xavierpinho xavierpinho merged commit 706a17b into master Jun 12, 2024
5 checks passed
@xavierpinho xavierpinho deleted the xavierp/python/index-access-after-call-tr branch June 12, 2024 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Relates to pysrc2cpg type recovery Concerns Joern's WIP type recovery
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants