This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
17661fb
)
regcomp.c: Add assertion
author
Karl Williamson
<khw@cpan.org>
Sat, 21 Oct 2017 23:24:11 +0000
(17:24 -0600)
committer
Karl Williamson
<khw@cpan.org>
Sat, 21 Oct 2017 23:39:02 +0000
(17:39 -0600)
If this value is negative, something is wrong.
regcomp.c
patch
|
blob
|
blame
|
history
diff --git
a/regcomp.c
b/regcomp.c
index
18e87e1
..
95c3afc
100644
(file)
--- a/
regcomp.c
+++ b/
regcomp.c
@@
-628,7
+628,7
@@
static const scan_data_t zero_scan_data = {
UTF8fARG(UTF, \
(xI(xC) > eC) /* Don't run off end */ \
? eC - sC /* Length before the <--HERE */ \
- :
xI_offset(xC),
\
+ :
( __ASSERT_(xI_offset(xC) >= 0) xI_offset(xC) ),
\
sC), /* The input pattern printed up to the <--HERE */ \
UTF8fARG(UTF, \
(xI(xC) > eC) ? 0 : eC - xI(xC), /* Length after <--HERE */ \