Skip to content

Fix: copy_a deallocation in determinant #815

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
May 16, 2024

Conversation

perazz
Copy link
Member

@perazz perazz commented May 16, 2024

I noticed a typo in det that does not deallocate the internal pointer matrix properly: it should be when the temporary is created (copy_a==.true.):

if (.not.copy_a) deallocate(amat)

I don't know why an error was never printed in the tests, as it should be impossible to deallocate the target
of a pointer, if this is not allocatable.
Anyways this is a fix for it, plus an additional test.

cc: @jvdp1 @jalvesz

Copy link
Member

@jvdp1 jvdp1 left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you @perazz

@perazz
Copy link
Member Author

perazz commented May 16, 2024

Thank you @jvdp1. I will merge this as it was a clear bug.

@perazz perazz merged commit 42182b0 into fortran-lang:master May 16, 2024
17 checks passed
@perazz perazz deleted the fix_deallocate branch May 16, 2024 10:11
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants