projects
/
platform
/
upstream
/
perl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dd58aee
)
regcomp.c: Reorder if to silence valgrind
author
Karl Williamson
<public@khwilliamson.com>
Fri, 18 Mar 2011 16:24:04 +0000
(10:24 -0600)
committer
Karl Williamson
<public@khwilliamson.com>
Fri, 18 Mar 2011 16:36:01 +0000
(10:36 -0600)
It is better to test that a pointer is in bounds before dereferencing it
even though in this case it doesn't lead to an actual error.
regcomp.c
patch
|
blob
|
history
diff --git
a/regcomp.c
b/regcomp.c
index
addc0d0
..
1e11827
100644
(file)
--- a/
regcomp.c
+++ b/
regcomp.c
@@
-9921,8
+9921,10
@@
parseit:
}
else {
prevvalue = value; /* save the beginning of the range */
- if (*RExC_parse == '-' && RExC_parse+1 < RExC_end &&
- RExC_parse[1] != ']') {
+ if (RExC_parse+1 < RExC_end
+ && *RExC_parse == '-'
+ && RExC_parse[1] != ']')
+ {
RExC_parse++;
/* a bad range like \w-, [:word:]- ? */