summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorJames E Keenan <jkeenan@cpan.org>2019-12-15 17:38:35 -0500
committerJames E Keenan <jkeenan@cpan.org>2019-12-16 23:12:25 -0500
commit5162664ad5f98a91d900af385de396cff1a34d47 (patch)
tree769b1906f316f1205fcb516f2cd3cd6906c8f914 /op.c
parent69e897fc6e08ebb39cc69575e11460b121069a4c (diff)
downloadperl-5162664ad5f98a91d900af385de396cff1a34d47.tar.gz
Local variable 'o' hides a parameter of the same name.
This sub-optimal code has been reported by LGTM static code analysis. There are actually two such instances very close to one another within op.c. This commit handles only the first of them, renaming a variable and regularizing the indents to make the relevant scope more self-evident.
Diffstat (limited to 'op.c')
-rw-r--r--op.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/op.c b/op.c
index de1e1f10b6..c04bdc1de1 100644
--- a/op.c
+++ b/op.c
@@ -8017,24 +8017,24 @@ Perl_pmruntime(pTHX_ OP *o, OP *expr, OP *repl, UV flags, I32 floor)
is_compiletime = 1;
has_code = 0;
if (expr->op_type == OP_LIST) {
- OP *o;
- for (o = cLISTOPx(expr)->op_first; o; o = OpSIBLING(o)) {
- if (o->op_type == OP_NULL && (o->op_flags & OPf_SPECIAL)) {
- has_code = 1;
- assert(!o->op_next);
- if (UNLIKELY(!OpHAS_SIBLING(o))) {
- assert(PL_parser && PL_parser->error_count);
- /* This can happen with qr/ (?{(^{})/. Just fake up
- the op we were expecting to see, to avoid crashing
- elsewhere. */
- op_sibling_splice(expr, o, 0,
- newSVOP(OP_CONST, 0, &PL_sv_no));
- }
- o->op_next = OpSIBLING(o);
- }
- else if (o->op_type != OP_CONST && o->op_type != OP_PUSHMARK)
- is_compiletime = 0;
- }
+ OP *this_o;
+ for (this_o = cLISTOPx(expr)->op_first; this_o; this_o = OpSIBLING(this_o)) {
+ if (this_o->op_type == OP_NULL && (this_o->op_flags & OPf_SPECIAL)) {
+ has_code = 1;
+ assert(!this_o->op_next);
+ if (UNLIKELY(!OpHAS_SIBLING(this_o))) {
+ assert(PL_parser && PL_parser->error_count);
+ /* This can happen with qr/ (?{(^{})/. Just fake up
+ the op we were expecting to see, to avoid crashing
+ elsewhere. */
+ op_sibling_splice(expr, this_o, 0,
+ newSVOP(OP_CONST, 0, &PL_sv_no));
+ }
+ this_o->op_next = OpSIBLING(this_o);
+ }
+ else if (this_o->op_type != OP_CONST && this_o->op_type != OP_PUSHMARK)
+ is_compiletime = 0;
+ }
}
else if (expr->op_type != OP_CONST)
is_compiletime = 0;