Fix prop_get_version_number leaving present major/minor undefined#975
Draft
v1kko wants to merge 1 commit into
Draft
Fix prop_get_version_number leaving present major/minor undefined#975v1kko wants to merge 1 commit into
v1kko wants to merge 1 commit into
Conversation
major and minor are intent(out) optional arguments. The routine returns early without assigning them when the version key is absent or cannot be parsed, leaving a present argument undefined for the caller. Initialise the results to the default version 1.0 and write the present outputs before the early returns; the success path still overwrites them with the parsed version. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix
prop_get_version_number: never leave a presentmajor/minorundefinedProblem
majorandminorareintent(out), optional. The routine returns early in twoplaces without assigning them:
prop_get_stringfails), andget_version_major_minor_integerfails).If the caller passed
major/minor, those arguments are left undefined onthose paths — undefined behaviour on any compiler.
Fix
Initialise the local results to the documented default (version 1.0) and write the
present
intent(out)arguments before the early returns, so they always hold adefined value. The success path continues to overwrite them with the parsed
version.