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

Incorrect logic in BackwardAnalysisImpl for exceptional successors #4861

Closed
msridhar opened this issue Aug 4, 2021 · 0 comments · Fixed by #4863
Closed

Incorrect logic in BackwardAnalysisImpl for exceptional successors #4861

msridhar opened this issue Aug 4, 2021 · 0 comments · Fixed by #4863

Comments

@msridhar
Copy link
Contributor

msridhar commented Aug 4, 2021

I was looking at the following code:

if (pred instanceof ExceptionBlock
&& ((ExceptionBlock) pred).getSuccessor() != null
&& node != null) {
@Nullable Block succBlock = ((ExceptionBlock) pred).getSuccessor();
@Nullable Block block = node.getBlock();
if (succBlock != null && block != null && succBlock.getUid() == block.getUid()) {
// If the block of passing node is an exceptional successor of Block pred, propagate
// store to the exceptionStores. Currently it doesn't track the label of an

It seems to be trying to check if block is an exceptional successor of pred. But the check is wrong, as ((ExceptionBlock) pred).getSuccessor() will get the non-exceptional successor (getExceptionalSuccessors() should be used instead). Reading the surrounding code, I think the impact of this bug is that in many cases, stores will not get propagated at all along exceptional control-flow edges in the backwards analysis. Not sure if there are tests for this.

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 a pull request may close this issue.

1 participant