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:
bf848a1
)
regcomp.c: Add assertions
author
Karl Williamson
<khw@cpan.org>
Thu, 14 Mar 2019 23:06:16 +0000
(17:06 -0600)
committer
Karl Williamson
<khw@cpan.org>
Thu, 14 Mar 2019 23:12:26 +0000
(17:12 -0600)
These make sure we don't exceed the 32 bits available for long jumps.
regcomp.c
patch
|
blob
|
blame
|
history
diff --git
a/regcomp.c
b/regcomp.c
index
73e8a83
..
5f2c863
100644
(file)
--- a/
regcomp.c
+++ b/
regcomp.c
@@
-19673,6
+19673,7
@@
S_regtail(pTHX_ RExC_state_t * pRExC_state,
}
if (reg_off_by_arg[OP(REGNODE_p(scan))]) {
+ assert(val - scan <= U32_MAX);
ARG_SET(REGNODE_p(scan), val - scan);
}
else {
@@
-19784,6
+19785,7
@@
S_regtail_study(pTHX_ RExC_state_t *pRExC_state, regnode_offset p,
);
});
if (reg_off_by_arg[OP(REGNODE_p(scan))]) {
+ assert(val - scan <= U32_MAX);
ARG_SET(REGNODE_p(scan), val - scan);
}
else {