You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
When used in a foreach loop, builtin::trim returns the same PV in subsequent iterations which then numifies to the same IV as in the first loop even though the PV has changed.
In the reported test case, trim() sets TARG (used for the return
value), and that is then evaluated in numeric context, setting the IV
slot and pIOK and possible IOK.
These aren't reset on the second call to trim from the same entersub
OP, and since TARG is re-used it still has the IV slot and pIOK/IOK
set, and so uses the cached numeric value when evaluating TARG in
numeric context again.
Clear all but the string related flags.
FixesPerl#22784
In the reported test case, trim() sets TARG (used for the return
value), and that is then evaluated in numeric context, setting the IV
slot and pIOK and possible IOK.
These aren't reset on the second call to trim from the same entersub
OP, and since TARG is re-used it still has the IV slot and pIOK/IOK
set, and so uses the cached numeric value when evaluating TARG in
numeric context again.
Clear all but the string related flags.
FixesPerl#22784
Description
When used in a foreach loop, builtin::trim returns the same PV in subsequent iterations which then numifies to the same IV as in the first loop even though the PV has changed.
Reported by damien on IRC
Steps to Reproduce
Expected behavior
outputting a PV of '4', IV of 4, PV of '5', and IV of 5
Perl configuration
The text was updated successfully, but these errors were encountered: