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 with dataset iterator processing #201

Merged
merged 3 commits into from
Jul 8, 2024

Conversation

khatchad
Copy link
Collaborator

@khatchad khatchad commented Jul 1, 2024

  • Fix bug with iterating over datasets whose elements may be tuples.
    • This happens when a tensor dataset generator outputs tensors in a specific format.
    • Previously, Ariadne was not inferring tensors that were being picked out of the tuple during dataset iteration.
    • Added corresponding tests.
  • Don't consider exceptions as tensor dataflow sources.
    • This was happening in the old code. I've added it to the new code as well.
  • Since invocation instructions are processed in multiple places, I've extracted a common method.
    • The two different call sites differ on the src points-to variable to be added.
    • This guarantees that the order in which the points-to variables are processed doesn't matter.

Always use the points-to analysis.
@khatchad khatchad added the bug Something isn't working label Jul 1, 2024
@khatchad khatchad requested a review from msridhar July 1, 2024 22:47
@khatchad khatchad marked this pull request as draft July 2, 2024 00:34
@khatchad khatchad removed the request for review from msridhar July 2, 2024 00:34
@khatchad khatchad requested a review from msridhar July 2, 2024 20:40
@khatchad khatchad marked this pull request as ready for review July 2, 2024 20:40
Copy link
Member

@msridhar msridhar left a comment

Choose a reason for hiding this comment

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

One suggestion

}
}
}
processInstruction(ni, du, localPointerKeyNode, src, vn, sources, pointerAnalysis);
Copy link
Member

Choose a reason for hiding this comment

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

Maybe processInvokeInstruction?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry for the delay. Yes, I also initially thought of that. But, then I decided to use method overloading:

  private static boolean processInstruction(
      SSAAbstractInvokeInstruction instruction,
      ...

In other words, the first parameter's type implicitly informs that an invoke instruction is being "processed." I can change it back if desired.

Copy link
Member

Choose a reason for hiding this comment

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

My preference is to change the method name to processInvokeInstruction for a bit more clarity (in my opinion). But it's up to you; you read this code a lot more than I do 🙂 Not a huge deal

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think that this is a good suggestion, but I wonder if we change this one, how many other ones are in a similar boat :).

@khatchad khatchad merged commit ef1cca7 into wala:master Jul 8, 2024
1 check passed
@khatchad khatchad deleted the contrib_dataset_bug branch July 8, 2024 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants