Skip to content

Fix hasAlternateReturn regression #237

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

Merged
merged 1 commit into from
Jul 2, 2020
Merged

Conversation

jeanPerier
Copy link
Collaborator

@jeanPerier jeanPerier commented Jul 2, 2020

The segfault was caused by the moving of hasAlternateReturns after GetCalleeAndArguments call. While it looked identical, it was not because GetCalleeAndArguments actually moved the analyzer.GetActuals().
https://github.com/llvm/llvm-project/blob/05756e6937d58c357b0b7e37ff3e9a8f7dd0d485/flang/lib/Semantics/expression.cpp#L1869

This later caused procRef.hasAlternateReturns() calls to return true on thing that were not alternate return calls, and a selectOp to be created with no target blocks, hence the segfault.

Just use callee->arguments where the arguments were moved to instead.

I pushing here to fix fir-dev, but this will need re-upstreaming in LLVM.

Copy link
Collaborator

@vdonaldson vdonaldson left a comment

Choose a reason for hiding this comment

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

Thanks Jean (and Tim).

@schweitzpgi schweitzpgi merged commit c8f3f05 into fir-dev Jul 2, 2020
@tskeith
Copy link
Collaborator

tskeith commented Jul 2, 2020

I've created https://reviews.llvm.org/D83063 to push this into llvm-project.

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.

4 participants