diff options
author | TAKAI Kousuke <62541129+t-a-k@users.noreply.github.com> | 2021-04-29 02:11:44 +0900 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2022-07-11 11:12:28 +1000 |
commit | 0cb18e027fe86875851f8cbf4bd48eb666ce5390 (patch) | |
tree | d2f5105e987c394930ff91d90dbaa98e4a9239cf /pp_sys.c | |
parent | 80c22fb4d7b4c52dc6e94cfdc4b7d7cd7109bd5a (diff) | |
download | perl-0cb18e027fe86875851f8cbf4bd48eb666ce5390.tar.gz |
setsockopt: use SvPOK to determine whether OPTVAL is string or integer
setsockopt (pp_ssockopt) used to treat its last argument (OPTVAL) as
a packed string whenever it has string slot set (SvPOKp), but this
would be confused if the argument is an integer but had cached
stringified value. Now it will treat OPTVAL as a packed string
only when it is originally created as a string, using Perl 5.36+'s
new (internal) feature where POK flag indicates whether the SV started
as a string.
Will fix GH #18642.
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2723,7 +2723,7 @@ PP(pp_ssockopt) const char *buf; int aint; SvGETMAGIC(sv); - if (SvPOKp(sv)) { + if (SvPOK(sv)) { /* sv is originally a string */ STRLEN l; buf = SvPVbyte_nomg(sv, l); len = l; |