summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-03-18 10:24:04 -0600
committerKarl Williamson <public@khwilliamson.com>2011-03-18 10:36:01 -0600
commit646253b5bb64d062851d102e7c6847ce5c5d3e18 (patch)
treeb9aed4f66da8181c5ece9b0de79d0b28e3515bff /regcomp.c
parentdd58aee1a749e6188a04cac2e4ba58a7004c1ec1 (diff)
downloadperl-646253b5bb64d062851d102e7c6847ce5c5d3e18.tar.gz
regcomp.c: Reorder if to silence valgrind
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.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/regcomp.c b/regcomp.c
index addc0d0266..1e1182706a 100644
--- 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:]- ? */