-
-
Notifications
You must be signed in to change notification settings - Fork 129
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: nullptr while fetching array size in pass array by data #3759
Conversation
I am enabling auto merge since this is a small change, we can revert back and apply any changes we need in subsequent PRs. |
length = ASRUtils::get_size(array, i + 1, al); | ||
} else { | ||
length = PassUtils::get_bound(array, i + 1, "ubound", al); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is going on here: for the above example it seems that both size and ubound is 9.
Is the issue that allocatable argument can have different lower and upper bound, say 10..19, while size is always 9? If so, the above test case does not seem to exercise this option. Finally, in ASR we always store the size (9) and lower bound (10). Here you are using ubound (19) and use it as "length".
That seems like a bug?
I created an issue for this at #3779.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I referred how did we populated start
when it is nullptr, there we used lbound
thus went for ubound
in case of length = nullptr
.
Will check and post a fix.
Fixes #3756. With this PR we get
stdlib_stats_median
compiled to LLVM.