summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-07-11 19:38:53 -0600
committerKarl Williamson <public@khwilliamson.com>2013-07-16 13:58:10 -0600
commit3181145612dc5cab2ed1607d61354a2853124119 (patch)
treed474f367618b39a92733d99ae2391f7da185b3fc
parent35e47f8f3db9920ffde3be36c5786bba8f0cbd8e (diff)
downloadperl-3181145612dc5cab2ed1607d61354a2853124119.tar.gz
regcomp.c: Remove now useless initialization
This code was designed to cause a segfault by initializing an offset into an address to a very large value. But now, it is stored as a bool, so there is not point in doing this. We also remove an assert that it is a bool, because it always has to be.
-rw-r--r--regcomp.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/regcomp.c b/regcomp.c
index e1a936aef1..284ca6a404 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -7113,8 +7113,6 @@ S_invlist_array(pTHX_ SV* const invlist)
/* Must not be empty. If these fail, you probably didn't check for <len>
* being non-zero before trying to get the array */
assert(*_get_invlist_len_addr(invlist));
- assert(*get_invlist_offset_addr(invlist) == 0
- || *get_invlist_offset_addr(invlist) == 1);
/* The very first element always contains zero, The array begins either
* there, or if the inversion list is offset, at the element after it.
@@ -7206,7 +7204,6 @@ Perl__new_invlist(pTHX_ IV initial_size)
* system default is used instead */
SV* new_list;
- bool* offset_addr;
if (initial_size < 0) {
initial_size = 10;
@@ -7221,12 +7218,6 @@ Perl__new_invlist(pTHX_ IV initial_size)
/* Force iterinit() to be used to get iteration to work */
*get_invlist_iter_addr(new_list) = (STRLEN) UV_MAX;
- /* This should force a segfault if a method doesn't initialize this
- * properly. XXX Although now that the max is currently just 255, it might
- * not segfault. */
- offset_addr = get_invlist_offset_addr(new_list);
- *offset_addr = (U8) UV_MAX;
-
*get_invlist_previous_index_addr(new_list) = 0;
return new_list;
@@ -7245,7 +7236,7 @@ S__new_invlist_C_array(pTHX_ const UV* const list)
const STRLEN length = (STRLEN) list[0];
const UV version_id = list[1];
- const U8 offset = (U8) list[2];
+ const bool offset = cBOOL(list[2]);
#define HEADER_LENGTH 3
/* If any of the above changes in any way, you must change HEADER_LENGTH
* (if appropriate) and regenerate INVLIST_VERSION_ID by running