-
Notifications
You must be signed in to change notification settings - Fork 571
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
[PATCH] remove unused var in sv_eq_flags #16425
Comments
From @bulk88Created by @bulk88See attached patch. Perl Info
|
From @bulk880001-remove-unused-var-in-sv_eq_flags.patchFrom d84f8bd5b1b53dc93b5576ee2a4fbef076837042 Mon Sep 17 00:00:00 2001
From: Daniel Dragan <bulk88@hotmail.com>
Date: Sun, 18 Feb 2018 02:30:35 -0500
Subject: [PATCH] remove unused var in sv_eq_flags
svrecode became unused in commit 8df0e7a28b
"Remove IN_ENCODING macro, and all code dependent on it" but there was
still a SvREFCNT_dec(NULL) executed at the end of the function. This commit
will reduce size of Perl_sv_eq_flags by the CC not having to save var eq
to a non-volatile register or stack location around the SvREFCNT_dec func
call and instead store var eq in the return register directly.
---
sv.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/sv.c b/sv.c
index fa5295d..ab0e157 100644
--- a/sv.c
+++ b/sv.c
@@ -7803,7 +7803,6 @@ Perl_sv_eq_flags(pTHX_ SV *sv1, SV *sv2, const U32 flags)
const char *pv2;
STRLEN cur2;
I32 eq = 0;
- SV* svrecode = NULL;
if (!sv1) {
pv1 = "";
@@ -7844,8 +7843,6 @@ Perl_sv_eq_flags(pTHX_ SV *sv1, SV *sv2, const U32 flags)
if (cur1 == cur2)
eq = (pv1 == pv2) || memEQ(pv1, pv2, cur1);
-
- SvREFCNT_dec(svrecode);
return eq;
}
--
1.7.9.msysgit.0
|
From @bulk88On Sat, 17 Feb 2018 23:33:05 -0800, bulk88 wrote:
made a better patch, removes the var entirely |
From @bulk880001-remove-unused-var-in-sv_eq_flags.patchFrom fd485190334d8775451f59bb8761defdcb09e802 Mon Sep 17 00:00:00 2001
From: Daniel Dragan <bulk88@hotmail.com>
Date: Sun, 18 Feb 2018 02:57:39 -0500
Subject: [PATCH] remove unused var in sv_eq_flags
svrecode became unused in commit 8df0e7a28b
"Remove IN_ENCODING macro, and all code dependent on it" but there was
still a SvREFCNT_dec(NULL) executed at the end of the function. This
commit will reduce size of Perl_sv_eq_flags by the CC not having to
save var eq to a non-volatile register or stack location around the
SvREFCNT_dec func call and instead store var eq in the return register
directly. Also remove the eq var completly, since initializing the var
so early means it has to be stored on the stack around alot func calls,
so just do a direct return of const zero on the only "fall off the end"
path in the func.
---
sv.c | 10 +++-------
1 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/sv.c b/sv.c
index fa5295d..c090c01 100644
--- a/sv.c
+++ b/sv.c
@@ -7802,8 +7802,6 @@ Perl_sv_eq_flags(pTHX_ SV *sv1, SV *sv2, const U32 flags)
STRLEN cur1;
const char *pv2;
STRLEN cur2;
- I32 eq = 0;
- SV* svrecode = NULL;
if (!sv1) {
pv1 = "";
@@ -7843,11 +7841,9 @@ Perl_sv_eq_flags(pTHX_ SV *sv1, SV *sv2, const U32 flags)
}
if (cur1 == cur2)
- eq = (pv1 == pv2) || memEQ(pv1, pv2, cur1);
-
- SvREFCNT_dec(svrecode);
-
- return eq;
+ return (pv1 == pv2) || memEQ(pv1, pv2, cur1);
+ else
+ return 0;
}
/*
--
1.7.9.msysgit.0
|
From @jkeenanOn Sun, 18 Feb 2018 07:58:16 GMT, bulk88 wrote:
I have made this patch available for smoke-testing in this branch: smoke-me/jkeenan/bulk88/132878-svrecode -- |
The RT System itself - Status changed from 'new' to 'open' |
From @tonycozOn Sat, 17 Feb 2018 23:58:16 -0800, bulk88 wrote:
Thanks, applied as 1c8104f. 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' |
Migrated from rt.perl.org#132878 (status was 'resolved')
Searchable as RT132878$
The text was updated successfully, but these errors were encountered: