-
Notifications
You must be signed in to change notification settings - Fork 182
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
Proposal to fix the procedure move
for string_type
#736
Conversation
move
for string_typemove
for string_type
@jvdp1
Does the initial (allocated) string But with GCC 13 all tests are passed now with proposed patches. |
It is to mimick the intrinsic move_alloc that deallocates FROM in the
process.
I will checks the specs and clarify them if needef
Le lun. 4 sept. 2023, 09:59, Sergey Torokhov ***@***.***> a
écrit :
… @jvdp1 <https://github.com/jvdp1>
I'm not sure why it's required this way
if(from%raw .eq. to%raw)then
deallocate(from%raw)
Does the initial (allocated) string str will be dealocated now if try to
do move(str, str)?
Or the from%raw or to%raw already called additional allocation?
But with GCC 13 all tests are passed now with proposed patches.
—
Reply to this email directly, view it on GitHub
<#736 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD5RO7B5ZUTDQQDYUPCYMCDXYWC5FANCNFSM6AAAAAA4JGKCM4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@jvdp1 |
Co-authored-by: Sebastian Ehlert <[email protected]>
Co-authored-by: Sebastian Ehlert <[email protected]>
@awvwgk I pushed your changes, but then the test "move: test case 8" failed. So, what should be the value of |
This changes the behaviour from undefined to copying to self will be a no-op. We would need to update the test and the specs, but I think it makes more sense this way. |
Ok. I modified both the tests and specs with the "new" behaviour. Could you @awvwgk have another check, please? |
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.
Looks good to me now
Issue (see #731 and #735 for more detail): seg fault occurs when the input and output
string_type
variable is the same inmove
:call move( from, from)
@band-a-prend @nkevy @awvwgk Would this proposition work for you? Could you test it with GCC 13, please?
Fixes #731 and #735