New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use SvLEN_set/SvCUR_set in a few extra locations #16171
Comments
From @atoomicThis is a bug report for perl from atoomic@cpan.org, SvLEN was set without using the generic macro SvLEN_set. run test on linux using: TEST_JOBS=10 make -j10 test_harness Flags: Site configuration information for perl 5.27.5: Configured by root at Mon Sep 25 13:38:40 CDT 2017. Summary of my perl5 (revision 5 version 27 subversion 5) configuration: @INC for perl 5.27.5: Environment for perl 5.27.5: PATH=/usr/local/cpanel/3rdparty/perl/526/bin:/usr/local/cpanel/3rdparty/perl/524/bin:/usr/local/cpanel/3rdparty/perl/522/bin:/usr/local/cpanel/3rdparty/perl/514/bin:/usr/local/cpanel/3rdparty/bin:/root/bin/:/opt/local/bin:/opt/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/cpanel/composer/bin:/root/.dotfiles/bin:/root/perl5/bin:/root/.rvm/bin:/root/bin |
From @atoomic0001-Use-SvLEN_set-SvCUR_set-in-a-few-extra-locations.patchFrom 8dbf3fcb11c15d2503dd8f6a902429bbd53e0acf Mon Sep 17 00:00:00 2001
From: Nicolas R <atoomic@cpan.org>
Date: Mon, 25 Sep 2017 13:37:06 -0500
Subject: [PATCH] Use SvLEN_set/SvCUR_set in a few extra locations
SvLEN was set without using the generic macro SvLEN_set.
Use it in three extra locations, and also use SvCUR_set
instead of SvCUR.
---
gv.c | 2 +-
toke.c | 4 ++--
universal.c | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/gv.c b/gv.c
index 6df78cc013..5a1bbd8608 100644
--- a/gv.c
+++ b/gv.c
@@ -1262,7 +1262,7 @@ Perl_gv_autoload_pvn(pTHX_ HV *stash, const char *name, STRLEN len, U32 flags)
sv_setsv_nomg((SV *)cv, tmpsv);
SvTEMP_off(tmpsv);
SvREFCNT_dec_NN(tmpsv);
- SvLEN(cv) = SvCUR(cv) + 1;
+ SvLEN_set(cv, SvCUR(cv) + 1);
SvCUR(cv) = ulen;
}
else {
diff --git a/toke.c b/toke.c
index a91a4fcfbe..74e0027f7d 100644
--- a/toke.c
+++ b/toke.c
@@ -4443,8 +4443,8 @@ Perl_filter_add(pTHX_ filter_t funcp, SV *datasv)
PL_parser->last_uni = buf + last_uni_pos;
if (PL_parser->last_lop)
PL_parser->last_lop = buf + last_lop_pos;
- SvLEN(linestr) = SvCUR(linestr);
- SvCUR(linestr) = s-SvPVX(linestr);
+ SvLEN_set(linestr, SvCUR(linestr));
+ SvCUR_set(linestr, s - SvPVX(linestr));
PL_parser->filtered = 1;
break;
}
diff --git a/universal.c b/universal.c
index 65477fb775..2262939b8d 100644
--- a/universal.c
+++ b/universal.c
@@ -225,8 +225,8 @@ Perl_sv_does_sv(pTHX_ SV *sv, SV *namesv, U32 flags)
/* create a PV with value "isa", but with a special address
* so that perl knows we're really doing "DOES" instead */
methodname = newSV_type(SVt_PV);
- SvLEN(methodname) = 0;
- SvCUR(methodname) = strlen(PL_isa_DOES);
+ SvLEN_set(methodname, 0);
+ SvCUR_set(methodname, strlen(PL_isa_DOES));
SvPVX(methodname) = (char *)PL_isa_DOES; /* discard 'const' qualifier */
SvPOK_on(methodname);
sv_2mortal(methodname);
--
2.14.1
|
From @atoomicinline patch On Mon, 25 Sep 2017 11:48:15 -0700, atoomic@cpan.org wrote:
|
From @atoomic0001-Use-SvLEN_set-SvCUR_set-in-a-few-extra-locations.patchFrom 8dbf3fcb11c15d2503dd8f6a902429bbd53e0acf Mon Sep 17 00:00:00 2001
From: Nicolas R <atoomic@cpan.org>
Date: Mon, 25 Sep 2017 13:37:06 -0500
Subject: [PATCH] Use SvLEN_set/SvCUR_set in a few extra locations
SvLEN was set without using the generic macro SvLEN_set.
Use it in three extra locations, and also use SvCUR_set
instead of SvCUR.
---
gv.c | 2 +-
toke.c | 4 ++--
universal.c | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/gv.c b/gv.c
index 6df78cc013..5a1bbd8608 100644
--- a/gv.c
+++ b/gv.c
@@ -1262,7 +1262,7 @@ Perl_gv_autoload_pvn(pTHX_ HV *stash, const char *name, STRLEN len, U32 flags)
sv_setsv_nomg((SV *)cv, tmpsv);
SvTEMP_off(tmpsv);
SvREFCNT_dec_NN(tmpsv);
- SvLEN(cv) = SvCUR(cv) + 1;
+ SvLEN_set(cv, SvCUR(cv) + 1);
SvCUR(cv) = ulen;
}
else {
diff --git a/toke.c b/toke.c
index a91a4fcfbe..74e0027f7d 100644
--- a/toke.c
+++ b/toke.c
@@ -4443,8 +4443,8 @@ Perl_filter_add(pTHX_ filter_t funcp, SV *datasv)
PL_parser->last_uni = buf + last_uni_pos;
if (PL_parser->last_lop)
PL_parser->last_lop = buf + last_lop_pos;
- SvLEN(linestr) = SvCUR(linestr);
- SvCUR(linestr) = s-SvPVX(linestr);
+ SvLEN_set(linestr, SvCUR(linestr));
+ SvCUR_set(linestr, s - SvPVX(linestr));
PL_parser->filtered = 1;
break;
}
diff --git a/universal.c b/universal.c
index 65477fb775..2262939b8d 100644
--- a/universal.c
+++ b/universal.c
@@ -225,8 +225,8 @@ Perl_sv_does_sv(pTHX_ SV *sv, SV *namesv, U32 flags)
/* create a PV with value "isa", but with a special address
* so that perl knows we're really doing "DOES" instead */
methodname = newSV_type(SVt_PV);
- SvLEN(methodname) = 0;
- SvCUR(methodname) = strlen(PL_isa_DOES);
+ SvLEN_set(methodname, 0);
+ SvCUR_set(methodname, strlen(PL_isa_DOES));
SvPVX(methodname) = (char *)PL_isa_DOES; /* discard 'const' qualifier */
SvPOK_on(methodname);
sv_2mortal(methodname);
--
2.14.1
|
The RT System itself - Status changed from 'new' to 'open' |
From @tonycozOn Mon, 25 Sep 2017 11:48:15 -0700, atoomic@cpan.org wrote:
Thanks, applied as 59c3c22. Tony |
@tonycoz - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release yesterday of Perl 5.28.0, this and 185 other issues have been Perl 5.28.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
From @atoomicThank you! Le sam. 23 juin 2018 à 09:31, Karl Williamson via RT <
|
Migrated from rt.perl.org#132160 (status was 'resolved')
Searchable as RT132160$
The text was updated successfully, but these errors were encountered: