-
Notifications
You must be signed in to change notification settings - Fork 119
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(stringlist): allocate string before assignment #1030
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,11 +63,13 @@ function GetStringFromList(list, indx) result(string) | |
class(*), pointer :: obj | ||
type(CharacterStringType), pointer :: charcont | ||
! | ||
string = '' | ||
obj => list%GetItem(indx) | ||
charcont => CastAsCharacterStringType(obj) | ||
if (associated(charcont)) then | ||
allocate (character(len=charcont%strlen()) :: string) | ||
string = charcont | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should be:
but please verify There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The suggestion is to replace line 70 right? |
||
else | ||
string = '' | ||
end if | ||
! | ||
return | ||
|
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.
should we say:
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 was thinking len should report 0 if not allocated but should have verified. I'll make the change.