Skip to content
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

fix missing parentheses in 'if' statement #16517

Closed
p5pRT opened this issue Apr 20, 2018 · 6 comments
Closed

fix missing parentheses in 'if' statement #16517

p5pRT opened this issue Apr 20, 2018 · 6 comments

Comments

@p5pRT
Copy link

@p5pRT p5pRT commented Apr 20, 2018

Migrated from rt.perl.org#133132 (status was 'pending release')

Searchable as RT133132$

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Apr 20, 2018

From alexandr.savca89@gmail.com


{op, pp, regcomp}.c​: fix missing parentheses in 'if' statement



Flags​:
  category=core
  severity=low
  Type=Patch
  PatchStatus=HasPatch


@p5pRT
Copy link
Author

@p5pRT p5pRT commented Apr 20, 2018

From alexandr.savca89@gmail.com

0001-op-pp-regcomp-.c-fix-missing-parentheses-in-if-state.patch
From 4e337cb294798d68431c3685b7ab490b337682cc Mon Sep 17 00:00:00 2001
From: chinarulezzz <alexandr.savca89@gmail.com>
Date: Fri, 20 Apr 2018 20:54:12 +0300
Subject: [PATCH] {op, pp, regcomp}.c: fix missing parentheses in 'if'
 statement

---
 op.c      | 2 +-
 pp.c      | 2 +-
 regcomp.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/op.c b/op.c
index a05a1319d4..d5b17f4a5b 100644
--- a/op.c
+++ b/op.c
@@ -10351,7 +10351,7 @@ S_process_special_blocks(pTHX_ I32 floor, const char *const fullname,
 	    return FALSE;
     } else {
 	if (*name == 'E') {
-	    if strEQ(name, "END") {
+	    if (strEQ(name, "END")) {
 		DEBUG_x( dump_sub(gv) );
 		Perl_av_create_and_unshift_one(aTHX_ &PL_endav, MUTABLE_SV(cv));
 	    } else
diff --git a/pp.c b/pp.c
index d777ae4309..6c42cfe5db 100644
--- a/pp.c
+++ b/pp.c
@@ -4541,7 +4541,7 @@ PP(pp_fc)
                     for (; s < send; s++) {
                         STRLEN ulen;
                         UV fc = _to_uni_fold_flags(*s, tmpbuf, &ulen, flags);
-                        if UVCHR_IS_INVARIANT(fc) {
+                        if (UVCHR_IS_INVARIANT(fc)) {
                             if (full_folding
                                 && *s == LATIN_SMALL_LETTER_SHARP_S)
                             {
diff --git a/regcomp.c b/regcomp.c
index 800ab2d444..fe11aa6c1b 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -17502,7 +17502,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
                            literal
                         );
                 }
-                else if isMNEMONIC_CNTRL(value) {
+                else if (isMNEMONIC_CNTRL(value)) {
                     vWARN4(RExC_parse,
                            "\"%.*s\" is more clearly written simply as \"%s\"",
                            (int) (RExC_parse - rangebegin),
-- 
2.15.1

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Apr 20, 2018

From @jkeenan

On Fri, 20 Apr 2018 18​:17​:15 GMT, alexandr.savca89@​gmail.com wrote​:

-----------------------------------------------------------------
{op, pp, regcomp}.c​: fix missing parentheses in 'if' statement

We can study this ticket now, but because we're in code freeze any action on it must be deferred until 5.29.0.

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Apr 20, 2018

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

@p5pRT p5pRT commented May 26, 2019

From @khwilliamson

Thanks. Finally applied as916db6e8921c4bf39aa0645f0ac7e6f32f168617

Some of the changes were no longer applicable. This doesn't actually fix any bugs. The macros expand to have surrounding parentheses, but it is best to have explicit ones, which this patch adds.

--
Karl Williamson

@p5pRT
Copy link
Author

@p5pRT p5pRT commented May 26, 2019

@khwilliamson - Status changed from 'open' to 'pending release'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant