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

fix bug in removeDefLocalsOf, also lp issue #1118

Conversation

sahilagichani14
Copy link
Collaborator

No description provided.

…cannot-invoke-sootupcorejimplebasiclocalgetname-because-newlocal-is-null
List<Stmt> localOccurrences = new ArrayList<>();
for (Stmt stmt : stmts) {
if (stmt.equivTo(removedStmt)) continue;
List<Value> stmtUses = stmt.getUsesAndDefs().collect(Collectors.toList());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you really want stmt.getUsesAndDefs()? Shouldn't it be stmt.getUses()?

Copy link
Collaborator Author

@sahilagichani14 sahilagichani14 Oct 25, 2024

Choose a reason for hiding this comment

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

getUses only gives me only the right hand side values like b = virtualinvoke(a) but stmt.getUsesAndDefs() also gives me a = anything i.e definitions of a.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If it's the uses AND defs that you want then we should rename this method/variables.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

…cannot-invoke-sootupcorejimplebasiclocalgetname-because-newlocal-is-null
@stschott stschott merged commit 1390a6e into develop Oct 30, 2024
7 checks passed
@stschott stschott deleted the 1095-bug-nullpointerexception-cannot-invoke-sootupcorejimplebasiclocalgetname-because-newlocal-is-null branch October 30, 2024 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants