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] Coverity: UCHARAT unnecessary with isSPACE #13851
Comments
From @jhiUCHARAT is not only unnecessary here (and no other spot in the core Fix for Coverity perl5 CIDs 28937, 28938. |
From @jhi0001-UCHARAT-unnecessary-with-isSPACE.patchFrom 3da7696b432c00fabb8b9bd56f86b6076e762d19 Mon Sep 17 00:00:00 2001
From: Jarkko Hietaniemi <jhi@iki.fi>
Date: Tue, 6 May 2014 10:40:21 -0400
Subject: [PATCH] UCHARAT unnecessary with isSPACE().
UCHARAT is not only unnecessary here (and no other spot in the core
seems to use UCHARAT with isFOO()), but it also narrows the type so
that some of the code in isSPACE() becomes unreachable.
Fix for Coverity perl5 CIDs 28937, 28938.
---
regcomp.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/regcomp.c b/regcomp.c
index 920f7cb..884e1b0 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -13416,12 +13416,12 @@ parseit:
e = strchr(RExC_parse++, '}');
if (!e)
vFAIL2("Missing right brace on \\%c{}", c);
- while (isSPACE(UCHARAT(RExC_parse)))
+ while (isSPACE(*RExC_parse))
RExC_parse++;
if (e == RExC_parse)
vFAIL2("Empty \\%c{}", c);
n = e - RExC_parse;
- while (isSPACE(UCHARAT(RExC_parse + n - 1)))
+ while (isSPACE(*(RExC_parse + n - 1)))
n--;
}
else {
@@ -13441,7 +13441,7 @@ parseit:
* that bit) */
value ^= 'P' ^ 'p';
- while (isSPACE(UCHARAT(RExC_parse))) {
+ while (isSPACE(*RExC_parse)) {
RExC_parse++;
n--;
}
--
1.8.5.2 (Apple Git-48)
|
The RT System itself - Status changed from 'new' to 'open' |
@tsee - Status changed from 'open' to 'resolved' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Migrated from rt.perl.org#121898 (status was 'resolved')
Searchable as RT121898$
The text was updated successfully, but these errors were encountered: