Skip to content

fix: sanitizer handling extra statements outside the function to complete#189

Merged
ganler merged 2 commits intoevalplus:masterfrom
Co1lin:master
May 4, 2024
Merged

fix: sanitizer handling extra statements outside the function to complete#189
ganler merged 2 commits intoevalplus:masterfrom
Co1lin:master

Conversation

@Co1lin
Copy link
Contributor

@Co1lin Co1lin commented May 4, 2024

Fix #188

@Co1lin Co1lin marked this pull request as draft May 4, 2024 04:05
@Co1lin
Copy link
Contributor Author

Co1lin commented May 4, 2024

The first case in the issue can be fixed by this commit.
For the second one I tried this, but I'm not sure. In my understanding, if a definition node is not a dependency of the entrypoint, we should not add it. The condition not (name in variable_names) should be removed.

@Co1lin Co1lin marked this pull request as ready for review May 4, 2024 04:15
Copy link
Member

@ganler ganler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you @Co1lin

@ganler ganler merged commit b297bb9 into evalplus:master May 4, 2024
@ganler
Copy link
Member

ganler commented May 4, 2024

Would also be nice if you can submit another PR to add a test case at: https://github.com/evalplus/evalplus/blob/master/tests/test_treesitter_sanitizer.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 [Bug] sanitizer cannot handle additional statements

2 participants