Repository navigation
interp: an undefined named parameter in a sub definition reads as zero - #4725
Merged
grandixximo merged 1 commit intoOct 26, 2026
Merged
Conversation
read_named_parameter() skips the "not defined" error while a sub is being defined, but returned without writing the result. The caller's stack variable stayed uninitialized and read_real_value() then tested it for NaN and infinity. On i386 the leftover value is sometimes NaN, so "o#<sub> call" inside a sub definition failed with "Calculation resulted in 'not a number'"; tests/interp/oword-bug315-p2 flaked on the i386 CI job this way. Valgrind reports the uninitialized read on x86-64 too.
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.
While a sub is being defined,
read_named_parameter()skips the "Named parameter not defined" error for an undefined named parameter, but it returnedINTERP_OKwithout writing*double_ptr. The caller's localdoublestayed uninitialized, andread_real_value()then checked it withisnan()/isinf().On i386 the leftover stack value is sometimes NaN, so a line like
o#<sub> callinside a sub definition fails withCalculation resulted in 'not a number'. This is the intermittenttests/interp/oword-bug315-p2failure on the i386 package job, for example on the Weblate PR #4723, which only touches.pofiles.Valgrind shows the read on x86-64 as well:
The fix sets the value to 0.0 in that branch. With it, valgrind is clean on
oword-bug315-p2andtests/interppasses (98/98).