Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion regcomp_invlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,19 @@ void
Perl_populate_bitmap_from_invlist(pTHX_ SV * invlist, const UV offset, const U8 * bitmap, const Size_t len)
{
PERL_ARGS_ASSERT_POPULATE_BITMAP_FROM_INVLIST;
ASSUME(invlist && bitmap);

/* As the name says. The zeroth bit corresponds to the code point given by
* 'offset' */

UV start, end;

Zero(bitmap, len, U8);
if (len == sizeof(U64)
&& ( ((STRUCT_OFFSET(struct regnode_bbm, bitmap) % 8) == 0)
|| (PTR2nat(bitmap) & 0x7) == 0))
*(U64*)bitmap = 0;
else
Zero(bitmap, len, U8);

invlist_iterinit(invlist);
while (invlist_iternext(invlist, &start, &end)) {
Expand Down
Loading