Fixed H5Ovisit2 change of behavior between 1.10.11 and v1.14.4.3 #4958
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In H5O_get_info() of 1.10.11:
set oinfo->type to 0, which was also the value of H5O_TYPE_GROUP, so oinfo->type accidentally had a correct value when the object was a group.
If oinfo->type were initialized to H5O_TYPE_UNKNOWN as it should be, the application would have behaved the same way as with 1.14.3, whose H5O_get_info() called H5O__reset_info2() that set oinfo->type to H5O_TYPE_UNKNOWN. So, it was a case of coincidentally correct behavior in 1.10.11.
The fix is to assign the correct value to oinfo->type early on instead of only when the requested info is H5O_INFO_BASIC. For that matter, probably all or some of the fields being set in the H5O_INFO_BASIC block should be changed the same way to prevent similar potential errors.
(Fixes GH #4941)