diff options
author | Karl Williamson <public@khwilliamson.com> | 2011-03-18 10:24:04 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2011-03-18 10:36:01 -0600 |
commit | 646253b5bb64d062851d102e7c6847ce5c5d3e18 (patch) | |
tree | b9aed4f66da8181c5ece9b0de79d0b28e3515bff /regcomp.c | |
parent | dd58aee1a749e6188a04cac2e4ba58a7004c1ec1 (diff) | |
download | perl-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.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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:]- ? */ |